瀏覽代碼

客户端-京东服务商从京推推换成官方

sunxbiao 11 月之前
父節點
當前提交
ec90a900f8
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      app/controller/api/store/product/Jd.php

+ 2 - 3
app/controller/api/store/product/Jd.php

@@ -492,14 +492,13 @@ class Jd extends BaseController
492
                     }
492
                     }
493
                     // 首次请求获取总页数
493
                     // 首次请求获取总页数
494
                     if ($page === 1 && isset($result['totalCount'])) {
494
                     if ($page === 1 && isset($result['totalCount'])) {
495
-                        // $maxPage = max(1, (int)ceil($result['totalCount'] / 50));
495
+                        $maxPage = max(1, (int)ceil($result['totalCount'] / 50));
496
                     }
496
                     }
497
                     // 处理数据
497
                     // 处理数据
498
                     if (!empty($result['data'])) {
498
                     if (!empty($result['data'])) {
499
                         $this->formatGoodsList($result['data'], $eliteId);
499
                         $this->formatGoodsList($result['data'], $eliteId);
500
                     }
500
                     }
501
                     $page++;
501
                     $page++;
502
-                    break;
503
                 } catch (\Exception $e) {
502
                 } catch (\Exception $e) {
504
                     // 记录错误并继续下一个分类
503
                     // 记录错误并继续下一个分类
505
                     log::info("JD API error (eliteId:{$eliteId}, page:{$page}): " . $e->getMessage());
504
                     log::info("JD API error (eliteId:{$eliteId}, page:{$page}): " . $e->getMessage());
@@ -573,7 +572,7 @@ class Jd extends BaseController
573
                 'commission_rate' => $goods['commissionInfo']['commissionShare'] ?? '',//佣金比例
572
                 'commission_rate' => $goods['commissionInfo']['commissionShare'] ?? '',//佣金比例
574
                 'coupon_money' => $couponMoney,
573
                 'coupon_money' => $couponMoney,
575
                 'coupon_link' => $maxCoupon['link'],
574
                 'coupon_link' => $maxCoupon['link'],
576
-                'lowestCouponPrice' => decimal2($goods['priceInfo']['lowestCouponPrice']), //券后价lowestCouponPrice
575
+                'lowestCouponPrice' => decimal2($goods['purchasePriceInfo']['purchasePrice']?? ($goods['priceInfo']['lowestCouponPrice']?? $goods['priceInfo']['price'])), //券后价lowestCouponPrice
577
                 'price' => $goods['priceInfo']['price'], //价格
576
                 'price' => $goods['priceInfo']['price'], //价格
578
                 'imageList' => array_column($goods['imageInfo']['imageList'], 'url'), //图片合集
577
                 'imageList' => array_column($goods['imageInfo']['imageList'], 'url'), //图片合集
579
                 'materialUrl' => $goods['materialUrl']
578
                 'materialUrl' => $goods['materialUrl']