|
|
@@ -64,11 +64,14 @@ class ExternalPlatformGoodsLists extends BaseAdminDataLists implements ListsSear
|
|
|
->select()
|
|
|
->toArray();
|
|
|
$goodsCategoryObj = GoodsCategory::where(['status'=>1])->order(['pid' => 'asc','weigh' => 'desc', 'id' => 'desc'])->select();
|
|
|
+
|
|
|
foreach ($lists as &$item) {
|
|
|
- $item['goods']['goods_category_ids'] = array_map("intval",$item['goods']['goods_category_ids']);
|
|
|
- $item['goods']['goods_category_ids_str'] = implode(' / ',$goodsCategoryObj->whereIn('id', $item['goods']['goods_category_ids'])->column('name'));
|
|
|
- $item['goods']['goods_image'] = $item['goods']['goods_image'] ? FileService::getFileUrl($item['goods']['goods_image']):null;
|
|
|
- $item['goods']['goods_video'] = $item['goods']['goods_video'] ? FileService::getFileUrl($item['goods']['goods_video']):null;
|
|
|
+ if($item['goods']){
|
|
|
+ $item['goods']['goods_category_ids'] = array_map("intval",$item['goods']['goods_category_ids']??[]);
|
|
|
+ $item['goods']['goods_category_ids_str'] = implode(' / ',$goodsCategoryObj->whereIn('id', $item['goods']['goods_category_ids']??[])->column('name'));
|
|
|
+ $item['goods']['goods_image'] = $item['goods']['goods_image'] ? FileService::getFileUrl($item['goods']['goods_image']):null;
|
|
|
+ $item['goods']['goods_video'] = $item['goods']['goods_video'] ? FileService::getFileUrl($item['goods']['goods_video']):null;
|
|
|
+ }
|
|
|
}
|
|
|
return $lists;
|
|
|
}
|