Compare commits
2 Commits
aac33677cd
...
68a29ca984
| Author | SHA1 | Date | |
|---|---|---|---|
| 68a29ca984 | |||
| f2c3200d28 |
@@ -43,6 +43,7 @@ class Video
|
||||
'name' => $params['name'] ?? null,
|
||||
'created_at' => !empty($params['created_at']) ? explode(",", $params['created_at']) : null
|
||||
])
|
||||
->language(request()->lang_id)
|
||||
->categoryId($params['category_id'] ?? null)
|
||||
->order(['sort' => 'desc', 'id' => 'desc'])
|
||||
->paginate([
|
||||
@@ -220,6 +221,7 @@ class Video
|
||||
'name' => $params['name']??null,
|
||||
'created_at' => !empty($params['created_at']) ? explode(',', $params['created_at']) : null,
|
||||
])
|
||||
->language(request()->lang_id)
|
||||
->categoryId($params['category_id']??null)
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
->select()
|
||||
|
||||
@@ -30,6 +30,7 @@ class VideoCategory
|
||||
->withSearch(['name'], [
|
||||
'name' => $param['name']??null
|
||||
])
|
||||
->language(request()->lang_id)
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
->paginate([
|
||||
'list_rows' => $param['size'],
|
||||
|
||||
@@ -39,6 +39,7 @@ class VideoTrash
|
||||
->withSearch(['name'], [
|
||||
'name' => $params['name']??null
|
||||
])
|
||||
->language(request()->lang_id)
|
||||
->categoryId($params['category_id']??null)
|
||||
->onlyTrashed()
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
|
||||
@@ -25,4 +25,10 @@ class VideoCategoryModel extends VideoCategoryBaseModel
|
||||
}
|
||||
$query->where('name', 'like', '%' . $value . '%');
|
||||
}
|
||||
|
||||
// 语言查询
|
||||
public function scopeLanguage($query, $value)
|
||||
{
|
||||
$query->where('language_id', '=', $value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,12 @@ class VideoModel extends VideoBaseModel
|
||||
}
|
||||
}
|
||||
|
||||
// 语言查询
|
||||
public function scopeLanguage($query, $value)
|
||||
{
|
||||
$query->where('language_id', '=', $value);
|
||||
}
|
||||
|
||||
// 分类查询
|
||||
public function scopeCategoryId($query, $value)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ declare (strict_types = 1);
|
||||
namespace app\common\model;
|
||||
|
||||
/**
|
||||
* 视频信息模型
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class VideoBaseModel extends BaseModel
|
||||
|
||||
@@ -4,6 +4,7 @@ declare (strict_types = 1);
|
||||
namespace app\common\model;
|
||||
|
||||
/**
|
||||
* 视频信息分类模型
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class VideoCategoryBaseModel extends BaseModel
|
||||
|
||||
Reference in New Issue
Block a user