Bladeren bron

feat: EK-856: 管理员增加“Country”属性.

kevinElken 9 maanden geleden
bovenliggende
commit
c84bc84c51

+ 0 - 2
backendApi/modules/v1/controllers/ShopController.php

@@ -956,8 +956,6 @@ class ShopController extends BaseController {
     {
         $orderSn = \Yii::$app->request->get('orderSn');
 
-        LoggerTool::info(json_encode(['actionOrderDetail', Yii::$app->getUser()->getUserInfo()]));
-
         $adminId = Yii::$app->getUser()->getUserInfo()['id'];
         $adminCountry = AdminCountry::getCountry($adminId);
         $quotedAdminCountry = array_map(function($item) {

+ 6 - 1
backendApi/modules/v1/models/lists/shop/OrderPeriodAdjustList.php

@@ -2,6 +2,7 @@
 namespace backendApi\modules\v1\models\lists\shop;
 
 use common\libs\dataList\DataListInterface;
+use common\models\Countries;
 use common\models\Order;
 use common\models\OrderPeriodAdjust;
 use common\libs\dataList\column\DateTime;
@@ -23,11 +24,12 @@ class OrderPeriodAdjustList extends \common\libs\dataList\DataList implements Da
     public function dataHandle()
     {
         $this->listData = OrderPeriodAdjust::lists($this->condition, $this->params, [
-            'select' => 'P.*,O.ORDER_TYPE',
+            'select' => 'P.*,O.ORDER_TYPE,O.COUNTRY_ID,C.NAME AS COUNTRY_NAME',
             'orderBy' => 'P.CREATED_AT DESC, P.ID DESC',
             'from' => OrderPeriodAdjust::tableName() . ' AS P',
             'join' => [
                 ['LEFT JOIN', Order::tableName() . ' AS O', 'P.ORDER_SN=O.SN'],
+                ['LEFT JOIN', Countries::tableName() . ' AS C', 'O.COUNTRY_ID=C.ID'],
             ],
             'page' => $this->page,
             'pageSize' => $this->pageSize,
@@ -51,6 +53,9 @@ class OrderPeriodAdjustList extends \common\libs\dataList\DataList implements Da
                         return $row['ORDER_TYPE'] == 'ZC' ? Yii::t('ctx', 'shopOrderListOrderTypeZc') : Yii::t('ctx', 'shopOrderListOrderTypeFx');
                     },
                 ],
+                'COUNTRY_NAME' => [
+                    'header' => Yii::t('ctx', 'country'),
+                ],
                 'ORIGIN_PERIOD' => [
                     'header' => Yii::t('ctx', 'beforeAdjustmentPcNo'),
                 ],