Merge pull request 'feat(store-product): 优化商品状态显示和库存字段' (#387) from dev into main

Reviewed-on: #387
This commit is contained in:
mkm 2024-12-13 11:04:34 +08:00
commit d31fdf90f2
2 changed files with 6 additions and 1 deletions

View File

@ -128,6 +128,11 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa
if ($userShip == 4) {
$item['price'] = $item['cost'];
}
if($item['is_show']==1){
$item['status_msg']='上架|常用';
}else{
$item['status_msg']='下架|不常用|是否有替换';
}
return $item;
})?->toArray();
if ($userShip > 0 && $userShip != 4) {

View File

@ -320,7 +320,7 @@ class StoreProductLogic extends BaseLogic
}else{
$data['status_msg']='下架|不常用|是否有替换';
}
$data['warehouse_nums']=WarehouseProductStorege::where('product_id', $params['id'])->where('warehouse_id',1)->value('nums')??0;
$data['stock']=WarehouseProductStorege::where('product_id', $params['id'])->where('warehouse_id',1)->value('nums')??0;
return $data;
}