feat: 添加对不存在商品信息的过滤
This commit is contained in:
parent
de036da9fb
commit
f132fb7f9b
@ -910,6 +910,7 @@ class WorkbenchLogic extends BaseLogic
|
|||||||
->select()->toArray();
|
->select()->toArray();
|
||||||
foreach ($list as $key => &$item) {
|
foreach ($list as $key => &$item) {
|
||||||
$find = StoreProduct::where('id', $item['product_id'])->field('store_name,image')->find();
|
$find = StoreProduct::where('id', $item['product_id'])->field('store_name,image')->find();
|
||||||
|
if(!$find) continue;
|
||||||
$item['store_name'] = $find['store_name'];
|
$item['store_name'] = $find['store_name'];
|
||||||
$item['image'] = $find['image'];
|
$item['image'] = $find['image'];
|
||||||
if ($item['profit'] == null) $item['profit'] = 0;
|
if ($item['profit'] == null) $item['profit'] = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user