Browse Source

跨境商品推送调整

kevin 1 year ago
parent
commit
f3a241199b
1 changed files with 7 additions and 1 deletions
  1. 7 1
      common/helpers/Logistics.php

+ 7 - 1
common/helpers/Logistics.php

@@ -4,6 +4,7 @@ namespace common\helpers;
 
 use common\models\OrderGoods;
 use common\models\Region;
+use common\models\ShopGoods;
 use Yii;
 
 class Logistics
@@ -132,7 +133,12 @@ class Logistics
         ];
 
         // 查询商品
-        $orderGoods = OrderGoods::find()->where('ORDER_SN=:ORDER_SN', [':ORDER_SN' => $order['SN']])->select('ORDER_SN,REAL_PRICE,BUY_NUMS,SKU_CODE,GOODS_TITLE,CONTENT')->asArray()->all();
+        $orderGoods = OrderGoods::find()
+            ->alias('O')
+            ->join('INNER JOIN', ShopGoods::tableName() . ' AS G', 'G.ID=O.GOODS_ID')
+            ->where('O.ORDER_SN=:ORDER_SN', [':ORDER_SN' => $order['SN']])->select('O.ORDER_SN,O.REAL_PRICE,O.BUY_NUMS,O.SKU_CODE,O.GOODS_TITLE,G.CONTENT')
+            ->asArray()
+            ->all();
         // 需要数量乘倍数的产品编号
         $stackedProducts = Cache::getSystemConfig()['stackedProducts']['VALUE'];
         $stackedProducts = explode(',', $stackedProducts);