feat(StoreOrderCartInfoGroupLists, StoreOrderCartInfoTwoLists): 优化了商品单位、分类和店铺名称的获取方式,增加了空值处理
This commit is contained in:
parent
315fd540ba
commit
5863d9d113
@ -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; //返回处理后的数据。
|
||||
})
|
||||
|
@ -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; //返回处理后的数据。
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user