瀏覽代碼

增加自动订单的列和筛选

theo 3 年之前
父節點
當前提交
66e3dc534b

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

@@ -387,6 +387,7 @@ class ShopController extends BaseController {
             'CREATED_AT'=> 'O.CREATED_AT',
             'ORDER_TYPE'=> 'O.ORDER_TYPE',
             'STATUS' => 'O.STATUS',
+            'IS_AUTO' => 'O.IS_AUTO'
         ]);
         $condition = ' 1=1 ' . $filter['condition'];
         $params = $filter['params'];

+ 6 - 6
backendApi/modules/v1/models/AdminForm.php

@@ -114,20 +114,20 @@ class AdminForm extends Model
         } elseif($this->scenario == 'noLoginModifyPassword') {
             $model =  Admin::findOne(["ADMIN_NAME"=>$this->adminName]);
             if( !$model ) {
-                $this->addError('noLoginModifyPassword', '不存在的用户名');
+                $this->addError('noLoginModifyPassword', 'The member name does not exist'); // 不存在的用户名
                 return null;
             }
             if( $this->oldPassword === $this->password ) {
-                $this->addError('noLoginModifyPassword', '登录密码没有发生改变');
+                $this->addError('noLoginModifyPassword', 'The login password has not changed'); // 登录密码没有发生改变
                 return null;
             }
             if ( !$model->validatePassword($this->oldPassword) ) {
-                $this->addError('noLoginModifyPassword', '原登录密码错误');
+                $this->addError('noLoginModifyPassword', 'The old login password is incorrect'); // 原登录密码错误
                 return null;
             }
             $model->IS_MODIFY_PASSWORD = 0;
         }else {
-            $this->addError('id', '提交场景不存在');
+            $this->addError('id', 'The submission does not exist'); // 提交场景不存在
             return null;
         }
 
@@ -135,7 +135,7 @@ class AdminForm extends Model
         if($this->password){
             if ($this->scenario == 'changePassword' || $this->scenario == 'noLoginModifyPassword'){
                 if (strlen($this->password) < 8){
-                    $this->addError($this->scenario, '登录密码不能小于8位');
+                    $this->addError($this->scenario, 'The password must contain at least eight characters'); // 登录密码不能小于8位
                     return null;
                 }
 //               $symbol = '!#$%^&*';
@@ -143,7 +143,7 @@ class AdminForm extends Model
                $passwordRules = '/^(?![\d]+$)(?![a-z]+$)(?![A-Z]+$)(?!['.$symbol.']+$)[\da-zA-z'.$symbol.']{8,}$/';
                $verificationResults = preg_match($passwordRules,$this->password);
                if (!$verificationResults){
-                   $this->addError($this->scenario, '登录密码中需要包含数字、大写字母、小写字母、特殊字符至少两种');
+                   $this->addError($this->scenario, 'The password must contain at least two types of digits, capital letters, small letters and special characters'); // 登录密码中需要包含数字、大写字母、小写字母、特殊字符至少两种
                    return null;
                }
             }

+ 27 - 5
backendApi/modules/v1/models/lists/shop/OrderList.php

@@ -204,6 +204,17 @@ class OrderList extends \common\libs\dataList\DataList implements DataListInterf
                         }
                     },
                 ],
+                'IS_AUTO' => [
+                    'header' => 'Is Auto', // 是否自动
+                    'value' => function ($row) {
+                        switch ($row['IS_AUTO']) {
+                            case 1:
+                                return 'Yes';
+                            case 0:
+                                return 'No';
+                        }
+                    },
+                ],
 //                'WAREHOUSE' => [
 //                    'header' => 'Delivery warehouse',//发货仓
 //                ],
@@ -367,12 +378,23 @@ class OrderList extends \common\libs\dataList\DataList implements DataListInterf
                 'ORDER_TYPE'=> ['name'=> 'Order Type'],
                 'PERIOD_NUM'=> ['name'=> 'Number of periods'],//期数
                 'CREATED_AT'=> ['name'=> 'Creation time', 'other'=>'date'],//创建时间
-                'STATUS'=> ['name'=> 'Status', 'other'=> 'select', 'selectData'=> [
-                    ['id' => \Yii::$app->params['orderStatus']['paid']['value'], 'name' => \Yii::$app->params['orderStatus']['paid']['label']],
-                    ['id' => \Yii::$app->params['orderStatus']['notPaid']['value'], 'name' => \Yii::$app->params['orderStatus']['notPaid']['label']],
-                    ['id' => \Yii::$app->params['orderStatus']['failPaid']['value'], 'name' => \Yii::$app->params['orderStatus']['failPaid']['label']]
+                'STATUS'=> [
+                    'name'=> 'Status',
+                    'other'=> 'select',
+                    'selectData'=> [
+                        ['id' => \Yii::$app->params['orderStatus']['paid']['value'], 'name' => \Yii::$app->params['orderStatus']['paid']['label']],
+                        ['id' => \Yii::$app->params['orderStatus']['notPaid']['value'], 'name' => \Yii::$app->params['orderStatus']['notPaid']['label']],
+                        ['id' => \Yii::$app->params['orderStatus']['failPaid']['value'], 'name' => \Yii::$app->params['orderStatus']['failPaid']['label']]
+                    ]
+                ],
+                'IS_AUTO' => [
+                    'name'=>'Is Auto',
+                    'other'=> 'select',
+                    'selectData'=> [
+                        ['id'=>1, 'name'=>'YES'],
+                        ['id'=>0, 'name'=>'NO'],
+                    ]
                 ]
-                ],
             ];
         }
         return $this->filterTypes;