style: 视频管理控制器代码格式调整

This commit is contained in:
2025-02-21 09:45:17 +08:00
parent c4ef5530ab
commit 0ca98ff83c

View File

@@ -40,7 +40,7 @@ class Video
$query->field(['id', 'name']);
}])
->withSearch(['name', 'created_at'], [
'name' => $params['name'] ?? null,
'name' => $params['name'] ?? null,
'created_at' => !empty($params['created_at']) ? explode(",", $params['created_at']) : null
])
->categoryId($params['category_id'] ?? null)
@@ -217,7 +217,7 @@ class Video
$query->field(['id', 'name']);
}])
->withSearch(['name', 'createtd_at'], [
'name' => $params['name']??null,
'name' => $params['name']??null,
'created_at' => !empty($params['created_at']) ? explode(',', $params['created_at']) : null,
])
->categoryId($params['category_id']??null)
@@ -226,10 +226,10 @@ class Video
->bindAttr('category', ['category_name' => 'name'])
->hidden(['category_id', 'category'])
->each(function ($item) use($domain, $image_path, $video_path) {
$item->image = $domain . $image_path . '/' . $item->image;
$item->video = $domain . $video_path . '/' . $item->video;
$item->image = $domain . $image_path . '/' . $item->image;
$item->video = $domain . $video_path . '/' . $item->video;
$item->recommend = $item->recommend == 1 ? '是' : '否';
$item->status = $item->status == 1 ? '启用' : '禁用';
$item->status = $item->status == 1 ? '启用' : '禁用';
return $item;
});
}