|
@@ -363,7 +363,7 @@ class GoodsService extends BaseService
|
|
|
return $datas;
|
|
|
}
|
|
|
|
|
|
- $goods = $this->model->from('goods as a')
|
|
|
+ $goods = $this->model->with(['skuList'])->from('goods as a')
|
|
|
->whereIn('a.goods_id',$ids)
|
|
|
->where(['a.status' => 1, 'a.mark' => 1])
|
|
|
->where('a.retail_price', '>', 0)
|
|
@@ -371,6 +371,18 @@ class GoodsService extends BaseService
|
|
|
->get();
|
|
|
$goods = $goods? $goods->toArray() : [];
|
|
|
if($goods){
|
|
|
+ foreach ($goods as &$item){
|
|
|
+ $skuList = isset($item['sku_list'])? $item['sku_list'] : [];
|
|
|
+ if($skuList){
|
|
|
+ $skus = [];
|
|
|
+ foreach ($skuList as $v){
|
|
|
+ $v['retail_price'] = $this->getRealSalePrice($v['plat_price']);
|
|
|
+ $skus[$v['sku_id']] = $v;
|
|
|
+ }
|
|
|
+
|
|
|
+ $item['sku_list'] = $skus;
|
|
|
+ }
|
|
|
+ }
|
|
|
RedisService::set($cacheKey, $goods, rand(3,5));
|
|
|
}
|
|
|
return $goods;
|