|
|
@@ -74,22 +74,10 @@ class GoodsLists extends BaseApiDataLists implements ListsSearchInterface
|
|
|
$lists = Goods::order(['id' => 'desc'])
|
|
|
->where($this->searchWhere)
|
|
|
->where($this->queryWhere())
|
|
|
- ->visible([
|
|
|
- 'id','goods_image','goods_video','goods_category_ids',
|
|
|
- 'goods_number','good_unit','base_service_fee',
|
|
|
- 'service_total','service_fee','service_image','fee_schedule','warranty_period'
|
|
|
- ])
|
|
|
+ ->field(['id', 'name', 'goods_id', 'picture', 'sort'])
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
->select()
|
|
|
->toArray();
|
|
|
- $goodsCategoryObj = GoodsCategory::where(['status'=>1])->order(['pid' => 'asc','weigh' => 'desc', 'id' => 'desc'])
|
|
|
- ->select();
|
|
|
- foreach ($lists as &$item) {
|
|
|
- $item['goods_category_ids'] = array_map("intval",$item['goods_category_ids']);
|
|
|
- $item['goods_category_ids_str'] = implode(' / ',$goodsCategoryObj->whereIn('id', $item['goods_category_ids'])->column('name'));
|
|
|
- $item['goods_image'] = $item['goods_image'] ? FileService::getFileUrl($item['goods_image']):null;
|
|
|
- $item['goods_video'] = $item['goods_video'] ? FileService::getFileUrl($item['goods_video']):null;
|
|
|
- }
|
|
|
return $lists;
|
|
|
}
|
|
|
|