refactor: 视频分类删除检查分类下是否存在视频
This commit is contained in:
@@ -11,6 +11,12 @@ use app\common\model\VideoCategoryBaseModel;
|
||||
*/
|
||||
class VideoCategoryModel extends VideoCategoryBaseModel
|
||||
{
|
||||
// 关联视频模型
|
||||
public function video()
|
||||
{
|
||||
return $this->hasMany(VideoModel::class, 'category_id', 'id');
|
||||
}
|
||||
|
||||
// 分类名称搜索
|
||||
public function searchNameAttr($query, $value)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user