refactor: 修改产品相关接口
This commit is contained in:
@@ -38,6 +38,8 @@ class Product
|
||||
'is_new',
|
||||
'is_hot',
|
||||
'is_sale',
|
||||
'is_show',
|
||||
'stock_qty',
|
||||
'status',
|
||||
'created_at'
|
||||
])
|
||||
@@ -111,6 +113,7 @@ class Product
|
||||
'is_sale',
|
||||
'is_new',
|
||||
'is_hot',
|
||||
'is_show',
|
||||
'sort',
|
||||
'detail',
|
||||
'params' => '',
|
||||
@@ -183,7 +186,7 @@ class Product
|
||||
return error('请确认操作对象是否存在');
|
||||
}
|
||||
|
||||
$product->is_sale = (int)!$product->is_sale;
|
||||
$product->is_show = (int)!$product->is_show;
|
||||
if (!$product->save()) {
|
||||
return error('操作失败');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user