Explorar el Código

会员列表修改

kevin hace 1 año
padre
commit
8ecabb5f86

+ 1 - 16
backendApi/modules/v1/controllers/UserController.php

@@ -120,7 +120,7 @@ class UserController extends BaseController
             'CREATED_AT' => 'U.CREATED_AT',
             'CREATED_AT' => 'U.CREATED_AT',
             'PERIOD_AT' => 'U.PERIOD_AT',
             'PERIOD_AT' => 'U.PERIOD_AT',
             'DEC_LV_NAME' => 'U.DEC_LV',
             'DEC_LV_NAME' => 'U.DEC_LV',
-            'COUNTRY_NAME' => 'U.COUNTRY_ID',
+            'COUNTRY' => 'U.COUNTRY_ID',
             'DEC_LV_UPDATED_AT' => 'U.DEC_LV_UPDATED_AT',
             'DEC_LV_UPDATED_AT' => 'U.DEC_LV_UPDATED_AT',
             'LAST_DEC_LV_NAME' => 'U.LAST_DEC_LV',
             'LAST_DEC_LV_NAME' => 'U.LAST_DEC_LV',
             'EMP_LV_NAME' => 'U.EMP_LV',
             'EMP_LV_NAME' => 'U.EMP_LV',
@@ -129,33 +129,18 @@ class UserController extends BaseController
             'LAST_CROWN_LV_NAME' => 'U.LAST_CROWN_LV',
             'LAST_CROWN_LV_NAME' => 'U.LAST_CROWN_LV',
             'REC_USER_NAME' => 'RU.USER_NAME',
             'REC_USER_NAME' => 'RU.USER_NAME',
             'CON_USER_NAME' => 'CU.USER_NAME',
             'CON_USER_NAME' => 'CU.USER_NAME',
-            'ID_CARD' => 'U.ID_CARD',
             'SPOUSE_NAME' => 'U.SPOUSE_NAME',
             'SPOUSE_NAME' => 'U.SPOUSE_NAME',
-            'SPOUSE_IDCARD' => 'U.SPOUSE_IDCARD',
-            'SYSTEM_NAME' => 'U.SYSTEM_ID',
             'MOBILE' => 'U.MOBILE',
             'MOBILE' => 'U.MOBILE',
             'TEL' => 'U.TEL',
             'TEL' => 'U.TEL',
             'DEC_USER_NAME' => 'DU.USER_NAME',
             'DEC_USER_NAME' => 'DU.USER_NAME',
             'IS_DEC' => 'U.IS_DEC',
             'IS_DEC' => 'U.IS_DEC',
             'IS_STUDIO' => 'U.IS_STUDIO',
             'IS_STUDIO' => 'U.IS_STUDIO',
             'DEC_ROLE_NAME' => 'U.DEC_ROLE_ID',
             'DEC_ROLE_NAME' => 'U.DEC_ROLE_ID',
-            'OPEN_BANK_NAME' => 'U.OPEN_BANK',
-            'BANK_AREA' => [
-                'FIELD' => ['U.BANK_PROVINCE', 'U.BANK_CITY', 'U.BANK_COUNTY'],
-                'BIND' => ['BANK_PROVINCE', 'BANK_CITY', 'BANK_COUNTY'],
-            ],
-            'BANK_ADDRESS' => 'U.BANK_ADDRESS',
-            'BANK_NO' => 'U.BANK_NO',
-            'SEX' => 'U.SEX',
-            'NATION_NAME' => 'U.NATION',
             'AREA' => [
             'AREA' => [
                 'FIELD' => ['U.PROVINCE', 'U.CITY', 'U.COUNTY'],
                 'FIELD' => ['U.PROVINCE', 'U.CITY', 'U.COUNTY'],
                 'BIND' => ['PROVINCE', 'CITY', 'COUNTY'],
                 'BIND' => ['PROVINCE', 'CITY', 'COUNTY'],
             ],
             ],
             'ADDRESS' => 'U.ADDRESS',
             'ADDRESS' => 'U.ADDRESS',
-            'VERIFIED' => 'U.VERIFIED',
-            'VERIFIED_AT' => 'U.VERIFIED_AT',
-            'ALLOW_TRANSFER' => 'UI.ALLOW_TRANSFER',
         ]);
         ]);
         $condition = $filter['condition'];
         $condition = $filter['condition'];
         $params = $filter['params'];
         $params = $filter['params'];

+ 26 - 3
backendApi/modules/v1/models/lists/user/IndexList.php

@@ -49,8 +49,8 @@ class IndexList extends \common\libs\dataList\DataList implements DataListInterf
                 CU.USER_NAME CON_USER_NAME,CU.REAL_NAME CON_REAL_NAME,
                 CU.USER_NAME CON_USER_NAME,CU.REAL_NAME CON_REAL_NAME,
                 RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,
                 RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,
                 DU.USER_NAME DEC_USER_NAME,
                 DU.USER_NAME DEC_USER_NAME,
-                CS.NAME COUNTRY_NAME,
-                LG.NAME LANGUAGE_NAME
+                CS.NAME COUNTRY,
+                LG.NAME LANGUAGE
                 ',
                 ',
             'orderBy' => 'UI.CREATED_AT DESC, UI.ID DESC',
             'orderBy' => 'UI.CREATED_AT DESC, UI.ID DESC',
             'from' => User::tableName() . ' AS U',
             'from' => User::tableName() . ' AS U',
@@ -125,6 +125,10 @@ class IndexList extends \common\libs\dataList\DataList implements DataListInterf
                     },
                     },
                     'headerOther' => ['width' => '110'],
                     'headerOther' => ['width' => '110'],
                 ],
                 ],
+                'COUNTRY' => [
+                    'header' => Yii::t('ctx', 'country'),
+                    'headerOther' => ['width' => '110'],
+                ],
 //                'ALLOW_LOGIN' => [
 //                'ALLOW_LOGIN' => [
 //                    'header' => Yii::t('ctx', 'filterAllowLogin'),
 //                    'header' => Yii::t('ctx', 'filterAllowLogin'),
 //                    'value' => function($row) {
 //                    'value' => function($row) {
@@ -400,11 +404,30 @@ class IndexList extends \common\libs\dataList\DataList implements DataListInterf
                 'DEC_USER_NAME'=> ['name'=> Yii::t('ctx', 'stockistCode')],
                 'DEC_USER_NAME'=> ['name'=> Yii::t('ctx', 'stockistCode')],
                 'IS_DEC'=> ['name'=> Yii::t('ctx', 'stockistOrNot'), 'other'=> 'yesOrNo'],
                 'IS_DEC'=> ['name'=> Yii::t('ctx', 'stockistOrNot'), 'other'=> 'yesOrNo'],
                 'DEC_ROLE_NAME'=> ['name'=> Yii::t('ctx', 'stockistLevel'), 'other'=> 'decRole'],
                 'DEC_ROLE_NAME'=> ['name'=> Yii::t('ctx', 'stockistLevel'), 'other'=> 'decRole'],
-                'COUNTRY_NAME'=> ['name'=> Yii::t('ctx', 'country'), 'other'=> 'countries'],
+                'COUNTRY'=> [
+                    'name'=> \Yii::t('ctx', 'country'),
+                    'other'=> 'select',
+                    'selectData'=> self::getCountry()
+                ],
                 'AREA'=> ['name'=> Yii::t('ctx', 'commonAddress'), 'other'=> 'area'],
                 'AREA'=> ['name'=> Yii::t('ctx', 'commonAddress'), 'other'=> 'area'],
                 'STATUS'=> ['name'=> Yii::t('ctx', 'activeStatus'), 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> Yii::t('ctx', 'locking')],['id'=> 1, 'name'=> Yii::t('ctx', 'activation')]]],
                 'STATUS'=> ['name'=> Yii::t('ctx', 'activeStatus'), 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> Yii::t('ctx', 'locking')],['id'=> 1, 'name'=> Yii::t('ctx', 'activation')]]],
             ];
             ];
         }
         }
         return $this->filterTypes;
         return $this->filterTypes;
     }
     }
+
+    public function getCountry()
+    {
+        $countries = Countries::getFromCache();
+
+        $data = [];
+        foreach ($countries as $country) {
+            $data[] = [
+                'id' => $country['ID'],
+                'name' => $country['NAME'],
+            ];
+        }
+
+        return $data;
+    }
 }
 }