diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index 9d44a554..944e3635 100644 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -315,9 +315,10 @@ class Goods extends Controller */ public function recommendedNew(): Json { + $param = $this->request->param(); $service = new GoodsService; - $goodsList = $service->recommendedNew(); + $goodsList = $service->recommendedNew($param); return $this->renderSuccess(compact('goodsList')); } /** diff --git a/app/api/model/Goods.php b/app/api/model/Goods.php index 33715cfd..51b556f5 100644 --- a/app/api/model/Goods.php +++ b/app/api/model/Goods.php @@ -575,6 +575,13 @@ class Goods extends GoodsModel $goodsInfo->skuList = GoodsSkuModel::where('spu_id', $goodsInfo->spu_id)->select(); } + foreach ($goodsInfo->skuList as &$value) { + //处理苏宁商品,京东价拖的问题 + if (in_array($goodsInfo['channel'], ['sn','sn1']) && $goodsInfo['link_other'] && $value->goods_id == $goodsId) { + $value->goods_sku_no = $goodsInfo['goods_no_other']; + } + } + // 判断商品是否存在 if (empty($goodsInfo) || $goodsInfo['is_delete']) { throwError('很抱歉,商品信息不存在'); diff --git a/app/api/service/Goods.php b/app/api/service/Goods.php index be61e22d..f7534194 100644 --- a/app/api/service/Goods.php +++ b/app/api/service/Goods.php @@ -177,7 +177,7 @@ class Goods extends GoodsService * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ - public function recommendedNew(): array + public function recommendedNew(array $param = []): array { // 获取商品推荐数据 $setting = $this->getRecommendedSetting(); @@ -192,6 +192,7 @@ class Goods extends GoodsService 'status' => 10, 'goodsIds' => implode(",",$setting['params']['goodsIds']), 'sortType' => "all", + 'page' => $param['page'] ?? 1, ], 10); } else { // 数据来源:自动 @@ -199,6 +200,7 @@ class Goods extends GoodsService 'status' => 10, 'categoryId' => $setting['params']['auto']['category'], 'sortType' => $setting['params']['auto']['goodsSort'], + 'page' => $param['page'] ?? 1, ], 10); } diff --git a/app/store/controller/Goods.php b/app/store/controller/Goods.php index 79448708..1ffe132f 100644 --- a/app/store/controller/Goods.php +++ b/app/store/controller/Goods.php @@ -295,7 +295,8 @@ class Goods extends Controller return $this->renderSuccess('删除成功'); } public function export(){ - + ini_set('memory_limit', '2024M'); + set_time_limit(0); $model = new GoodsModel; $params = $this->request->param(); $params['store_id'] = $this->storeId;