fix: 修复兼容配件类型状态筛选bug
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 3s
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 3s
This commit is contained in:
@@ -16,7 +16,7 @@ class ProductCompatParts
|
|||||||
{
|
{
|
||||||
$params = request()->param([
|
$params = request()->param([
|
||||||
'name',
|
'name',
|
||||||
'is_show',
|
'is_show' => null,
|
||||||
'page/d' => 1,
|
'page/d' => 1,
|
||||||
'size/d' => 10
|
'size/d' => 10
|
||||||
]);
|
]);
|
||||||
@@ -26,10 +26,7 @@ class ProductCompatParts
|
|||||||
'deleted_at'
|
'deleted_at'
|
||||||
])
|
])
|
||||||
->language(request()->lang_id)
|
->language(request()->lang_id)
|
||||||
->where(function($query) use($params) {
|
->disabled(is_null($params['is_show']) ? null : ($params['is_show'] == 1 ? 0 : 1))
|
||||||
if (empty($params['is_show'])) return;
|
|
||||||
$query->disabled($params['is_show'] == 1 ? 0 : 1);
|
|
||||||
})
|
|
||||||
->withSearch('name', [
|
->withSearch('name', [
|
||||||
'name' => $params['name']??null
|
'name' => $params['name']??null
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user