Browse Source

常规商品【不是企业商品】

whitefang 1 năm trước cách đây
mục cha
commit
75bc69297e
1 tập tin đã thay đổi với 1 bổ sung13 xóa
  1. 1 13
      app/api/lists/GoodsLists.php

+ 1 - 13
app/api/lists/GoodsLists.php

@@ -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;
     }