refactor: 修改产品分类列表接口加入语言查询条件
This commit is contained in:
@@ -24,6 +24,7 @@ class ProductCategory
|
||||
'level',
|
||||
'is_show'
|
||||
])
|
||||
->language(request()->lang_id)
|
||||
->withSearch(['name_nullable'], [
|
||||
'name_nullable' => $params['keywords']
|
||||
])
|
||||
|
||||
@@ -22,7 +22,13 @@ class ProductCategoryModel extends ProductCategoryBaseModel
|
||||
// 根据pid查询
|
||||
public function scopePid($query, $pid)
|
||||
{
|
||||
$query->where('pid', $pid);
|
||||
$query->where('pid', '=', $pid);
|
||||
}
|
||||
|
||||
// 所属语言查询
|
||||
public function scopeLanguage($query, $value)
|
||||
{
|
||||
$query->where('language_id', '=', $value);
|
||||
}
|
||||
|
||||
// 搜索分类名称
|
||||
|
||||
Reference in New Issue
Block a user