wesmiler hace 19 horas
padre
commit
7eca164643
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      app/Services/Api/GoodsService.php

+ 2 - 2
app/Services/Api/GoodsService.php

@@ -101,7 +101,7 @@ class GoodsService extends BaseService
             unset($where['a.status']);
         }
 
-        $model = $this->model->with(['category'])
+        $model = $this->model->with(['category','skus'])
             ->from('goods as a')
             ->where(function ($query) use ($params) {
                 // 分类
@@ -349,7 +349,7 @@ class GoodsService extends BaseService
             return $data;
         }
 
-        $data = $this->model->where(['zone_type'=>$type,'status'=>1,'mark'=>1])
+        $data = $this->model->with(['skus'])->where(['zone_type'=>$type,'status'=>1,'mark'=>1])
             ->select(['id','thumb','price','market_price','sku_type','goods_name','sales','stock','category_id','type','zone_type','is_new','status'])
             ->orderBy('sort','desc')
             ->orderBy('id','asc')