Merge pull request 'feat(StoreOrderCartInfoGroupLists, StoreOrderCartInfoTwoLists): 优化了商品单位、分类和店铺名称的获取方式,增加了空值处理' (#82) from erp into rose

Reviewed-on: #82
This commit is contained in:
mkm 2024-08-02 19:58:21 +08:00
commit f120ad28be
2 changed files with 15 additions and 5 deletions

View File

@ -61,12 +61,15 @@ class StoreOrderCartInfoGroupLists extends BaseAdminDataLists implements ListsSe
$item['image']=$find['image'];//商品图片
$item['store_name']=$find['store_name'];//商品名称
$item['store_info']=$find['store_info'];//商品规格
$item['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name');
$item['cate_name'] = StoreCategory::where('id', $find['cate_id'])->value('name');
$item['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name')??"";
$item['cate_name'] = StoreCategory::where('id', $find['cate_id'])->value('name')??"";
}else{
$item['image']='';//商品图片
$item['store_name']='';//商品名称
$item['store_info']='';//商品规格-(数据库叫商品简介)
$item['unit_name']='';//
$item['cate_name']='';//
$item['system_store']='';//
}
return $item; //返回处理后的数据。
})

View File

@ -65,9 +65,16 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear
$item['image'] = $find['image']; //商品图片
$item['store_name'] = $find['store_name']; //商品名称
$item['store_info'] = $find['store_info']; //商品规格
$item['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name');
$item['cate_name'] = StoreCategory::where('id', $find['cate_id'])->value('name');
$item['system_store'] = SystemStore::where('id', $item['store_id'])->value('name');
$item['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name')??'';
$item['cate_name'] = StoreCategory::where('id', $find['cate_id'])->value('name')??'';
$item['system_store'] = SystemStore::where('id', $item['store_id'])->value('name')??'';
}else{
$item['image']='';//商品图片
$item['store_name']='';//商品名称
$item['store_info']='';//商品规格-(数据库叫商品简介)
$item['unit_name']='';//
$item['cate_name']='';//
$item['system_store']='';//
}
return $item; //返回处理后的数据。
})