feat(store-product): 优化商品状态显示和库存字段

- 在 StoreProductLists 中添加商品状态消息,根据 is_show 字段值显示上架或下架状态
- 在 StoreProductLogic 中将 warehouse_nums 字段重命名为 stock,以更好地反映其含义
This commit is contained in:
mkm 2024-12-13 11:03:59 +08:00
parent 5d0e203d98
commit 8a884ea6fd
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;
}