|
|
@@ -3,8 +3,11 @@ namespace backendApi\modules\v1\models\lists\user;
|
|
|
|
|
|
use common\helpers\Cache;
|
|
|
use common\helpers\http\BackendToFrontendApi;
|
|
|
+use common\helpers\LoggerTool;
|
|
|
use common\helpers\user\Info;
|
|
|
use common\libs\dataList\DataListInterface;
|
|
|
+use common\models\BaUser;
|
|
|
+use common\models\BaUserInfo;
|
|
|
use common\models\DecRole;
|
|
|
use common\models\OpenBank;
|
|
|
use common\models\Region;
|
|
|
@@ -23,7 +26,7 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
|
|
|
* @return string
|
|
|
*/
|
|
|
public function getListName(){
|
|
|
- return '会员列表';
|
|
|
+ return 'Brand Ambassador List';
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -32,7 +35,7 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
|
|
|
public function dataHandle()
|
|
|
{
|
|
|
$this->condition .= ' AND UN.USER_ID=UI.USER_ID AND UN.PARENT_UID=UI.CON_UID';
|
|
|
- $this->listData = User::lists($this->condition, $this->params, [
|
|
|
+ $this->listData = BaUser::lists($this->condition, $this->params, [
|
|
|
'select' => 'U.*,
|
|
|
UI.USER_ID, UI.ZC_PV, UI.CON_UID, UI.REC_UID, UI.CON_NUM, UI.REC_NUM, UI.NETWORK_DEEP,
|
|
|
UI.RELATION_DEEP, UI.SYSTEM_ID, UI.IS_GROUP_LEADER, UI.IS_SYSTEM_LEADER, UI.IS_TEAM, UI.IS_BIND,
|
|
|
@@ -41,15 +44,15 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
|
|
|
UI.HIGHEST_EMP_LV, UI.CLOSE_LOGIN_AT, UI.PULLED_AT,
|
|
|
UI.GROUP_LEADER_AT, UI.ALLOW_TRANSFER, UI.ALLOW_RECONSUME_SMS, UI.ALLOW_RECONSUME_SMS_TO,
|
|
|
UI.HIGHEST_EMP_LV_PERIOD, UI.TRANSFER_PROP, UI.LOGIN_NUMS, UI.FAIL_NUMS, UI.LAST_LOGIN_IP,
|
|
|
- UI.LAST_LOGIN_AT, UI.SHOW_EMP_LV,UN.RELATIVE_LOCATION,
|
|
|
- CU.USER_NAME CON_USER_NAME,CU.REAL_NAME CON_REAL_NAME,
|
|
|
- RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,
|
|
|
- DU.USER_NAME DEC_USER_NAME
|
|
|
+ UI.LAST_LOGIN_AT, UI.SHOW_EMP_LV,UN.RELATIVE_LOCATION
|
|
|
',
|
|
|
+// CU.USER_NAME CON_USER_NAME,CU.REAL_NAME CON_REAL_NAME,
|
|
|
+// RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,
|
|
|
+// DU.USER_NAME DEC_USER_NAME
|
|
|
'orderBy' => 'UI.CREATED_AT DESC, UI.ID DESC',
|
|
|
- 'from' => User::tableName() . ' AS U',
|
|
|
+ 'from' => BaUser::tableName() . ' AS U',
|
|
|
'join' => [
|
|
|
- ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'UI.USER_ID=U.ID'],
|
|
|
+ ['LEFT JOIN', BaUserInfo::tableName() . ' AS UI', 'UI.USER_ID=U.ID'],
|
|
|
['LEFT JOIN', UserNetwork::tableName() . ' AS UN', 'UI.USER_ID=UN.USER_ID'],
|
|
|
['LEFT JOIN', User::tableName() . ' AS CU', 'UI.CON_UID=CU.ID'],
|
|
|
['LEFT JOIN', User::tableName() . ' AS RU', 'UI.REC_UID=RU.ID'],
|
|
|
@@ -58,6 +61,7 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
|
|
|
'page' => $this->page,
|
|
|
'pageSize' => $this->pageSize,
|
|
|
]);
|
|
|
+
|
|
|
foreach ($this->listData['list'] as $key => $value) {
|
|
|
// 后台访问前台的请求参数
|
|
|
if (!$this->isExport && Yii::$app->user->validateAdminAction('user', 'login-to-frontend')) {
|
|
|
@@ -78,13 +82,8 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
|
|
|
* 要展示和导出的所有字段
|
|
|
* @return array
|
|
|
*/
|
|
|
- public function getColumn(){
|
|
|
- $decLevelConfig = Cache::getDecLevelConfig();
|
|
|
- $empLevelConfig = Cache::getEmpLevelConfig();
|
|
|
- $crownLevelConfig = Cache::getStarCrownLevelConfig();
|
|
|
- $decRoleConfig = DecRole::getAllData();
|
|
|
- $systemConfig = UserSystem::getAllSystems();
|
|
|
- $openBankConfig = OpenBank::getAllOpenBank();
|
|
|
+ public function getColumn()
|
|
|
+ {
|
|
|
$regionConfig = Cache::getRegionConfig();
|
|
|
if(!$this->columns){
|
|
|
$this->columns = [
|
|
|
@@ -131,65 +130,6 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
|
|
|
'header' => 'Joining Period', // 加入期数
|
|
|
'headerOther' => ['width' => '180'],
|
|
|
],
|
|
|
- 'DEC_LV_NAME' => [
|
|
|
- 'header' => 'Current Member Level', // 实时会员级别
|
|
|
- 'headerOther' => ['width' => '160'],
|
|
|
- 'value' => function($row) use($decLevelConfig) {
|
|
|
- return $decLevelConfig[$row['DEC_LV']]['LEVEL_NAME'];
|
|
|
- },
|
|
|
- 'valueOther' => [
|
|
|
- 'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'DEC_LV_UPDATED_AT' => [
|
|
|
- 'header' => 'Current Adjustment Date', // 实时调整日期
|
|
|
- 'value' => function($row) {
|
|
|
- return (new DateTime([
|
|
|
- 'value' => $row['DEC_LV_UPDATED_AT'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => ['width' => '180'],
|
|
|
- ],
|
|
|
- 'LAST_DEC_LV_NAME' => [
|
|
|
- 'header' => 'PC Member Level', // 结算时会员级别
|
|
|
- 'headerOther' => [
|
|
|
- 'width' => '140',
|
|
|
- ],
|
|
|
- 'value' => function($row) use($decLevelConfig) {
|
|
|
- if (!$row['LAST_DEC_LV']) {
|
|
|
- return $decLevelConfig[$row['DEC_LV']]['LEVEL_NAME'];
|
|
|
- } else {
|
|
|
- return $decLevelConfig[$row['LAST_DEC_LV']]['LEVEL_NAME'];
|
|
|
- }
|
|
|
- },
|
|
|
- 'valueOther' => [
|
|
|
- 'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'EMP_LV_NAME' => [
|
|
|
- 'header' => 'Current Director Rank', // 实时聘级
|
|
|
- 'headerOther' => [
|
|
|
- 'width' => '160',
|
|
|
- ],
|
|
|
- 'value' => function($row) use($empLevelConfig) {
|
|
|
- return isset($empLevelConfig[$row['EMP_LV']])?$empLevelConfig[$row['EMP_LV']]['LEVEL_NAME']:'';
|
|
|
- },
|
|
|
- 'valueOther' => [
|
|
|
- 'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'CROWN_LV_NAME' => [
|
|
|
- 'header' => 'Current Crown Rank', // 实时星级
|
|
|
- 'headerOther' => [
|
|
|
- 'width' => '150',
|
|
|
- ],
|
|
|
- 'value' => function($row) use($crownLevelConfig) {
|
|
|
- return isset($crownLevelConfig[$row['CROWN_LV']])?$crownLevelConfig[$row['CROWN_LV']]['LEVEL_NAME']:'';
|
|
|
- },
|
|
|
- 'valueOther' => [
|
|
|
- 'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
|
|
|
- ],
|
|
|
- ],
|
|
|
'REC_USER_NAME' => [
|
|
|
'header' => 'Recommendation No', // 推荐编号
|
|
|
'headerOther' => ['width' => '160'],
|
|
|
@@ -198,18 +138,6 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
|
|
|
'header' => 'Recommended Name', // 推荐姓名
|
|
|
'headerOther' => ['width' => '160'],
|
|
|
],
|
|
|
- 'CON_USER_NAME' => [
|
|
|
- 'header' => 'Placement No', // 安置编号
|
|
|
- 'headerOther' => ['width' => '140'],
|
|
|
- ],
|
|
|
- 'CON_REAL_NAME' => [
|
|
|
- 'header' => 'Placement Name', // 安置姓名
|
|
|
- 'headerOther' => ['width' => '140'],
|
|
|
- ],
|
|
|
- 'RELATIVE_LOCATION' => [
|
|
|
- 'header' => 'Resettlement Area', // 安置区域
|
|
|
- 'headerOther' => ['width' => '140'],
|
|
|
- ],
|
|
|
'MOBILE' => [
|
|
|
'header' => 'Phone Number', // 手机号码
|
|
|
'value' => function($row) {
|
|
|
@@ -224,83 +152,6 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
|
|
|
},
|
|
|
'headerOther' => ['width' => '180'],
|
|
|
],
|
|
|
- 'DEC_USER_NAME' => [
|
|
|
- 'header' => 'Stockist Code', // 所属报单中心编号
|
|
|
- 'headerOther' => ['width' => '150'],
|
|
|
- ],
|
|
|
- 'IS_DEC' => [
|
|
|
- 'header' => 'Whether Declaration Center', // 是否报单中心
|
|
|
- 'value' => function($row) {
|
|
|
- return (new YesNo([
|
|
|
- 'value' => $row['IS_DEC'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => function($row) {
|
|
|
- return ['width' => '200'];
|
|
|
- },
|
|
|
- 'valueOther' => function($row) {
|
|
|
- return [
|
|
|
- 'tag'=>['type'=>(isset($row['IS_DEC']) && $row['IS_DEC'] )? 'success' : 'info', 'size' => 'small']
|
|
|
- ];
|
|
|
- },
|
|
|
- ],
|
|
|
- 'IS_ATLAS' => [
|
|
|
- 'header' => 'Wheter Atlas Display', // 是否显示图谱
|
|
|
- 'value' => function($row) {
|
|
|
- return (new YesNo([
|
|
|
- 'value' => $row['IS_ATLAS'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => function($row) {
|
|
|
- return [
|
|
|
- 'width' => '160',
|
|
|
- ];
|
|
|
- },
|
|
|
- 'valueOther' => function($row) {
|
|
|
- return [
|
|
|
- 'tag'=>['type'=>(isset($row['IS_ATLAS']) && $row['IS_ATLAS'] )? 'success' : 'info', 'size' => 'small']
|
|
|
- ];
|
|
|
- },
|
|
|
- ],
|
|
|
- 'IS_RECHARGE' => [
|
|
|
- 'header' => 'Wheter Recharge Display', // 是否显示充值
|
|
|
- 'value' => function($row) {
|
|
|
- return (new YesNo([
|
|
|
- 'value' => $row['IS_RECHARGE'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => function($row) {
|
|
|
- return [
|
|
|
- 'width' => '180',
|
|
|
- ];
|
|
|
- },
|
|
|
- 'valueOther' => function($row) {
|
|
|
- return [
|
|
|
- 'tag'=>['type'=>(isset($row['IS_RECHARGE']) && $row['IS_RECHARGE'] )? 'success' : 'info', 'size' => 'small']
|
|
|
- ];
|
|
|
- },
|
|
|
- ],
|
|
|
- 'DEC_ROLE_NAME' => [
|
|
|
- 'header' => 'Stockist Level', // 报单中心级别
|
|
|
- 'headerOther' => ['width' => '110'],
|
|
|
- 'value' => function($row) use($decRoleConfig) {
|
|
|
- return $decRoleConfig[$row['DEC_ROLE_ID']]['ROLE_NAME'] ?? '';
|
|
|
- },
|
|
|
- ],
|
|
|
- 'OPEN_BANK_NAME' => [
|
|
|
- 'header' => 'Bank Name', // 开户银行
|
|
|
- 'headerOther' => ['width' => '110'],
|
|
|
- 'value' => function($row) use($openBankConfig) {
|
|
|
- return $openBankConfig[$row['OPEN_BANK']]['BANK_NAME'] ?? '';
|
|
|
- },
|
|
|
- ],
|
|
|
- 'BANK_NO' => [
|
|
|
- 'header' => 'Bank Account Number', // 银行帐号
|
|
|
- 'headerOther' => ['width' => '220'],
|
|
|
- 'value' => function($row) {
|
|
|
- return "\t".$row['BANK_NO'];
|
|
|
- },
|
|
|
- ],
|
|
|
'AREA' => [
|
|
|
'header' => 'Common Address', // 常用地址
|
|
|
'value' => function($row) use($regionConfig) {
|
|
|
@@ -319,22 +170,6 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
|
|
|
'width' => '200'
|
|
|
],
|
|
|
],
|
|
|
- 'ALLOW_TRANSFER' => [
|
|
|
- 'header' => 'Enable "Transfer"', // 转账功能开启
|
|
|
- 'value' => function($row) {
|
|
|
- return $row['ALLOW_TRANSFER'] == 1 ? 'On': 'Off'; // '开启' : '关闭'
|
|
|
- },
|
|
|
- 'headerOther' => function($row) {
|
|
|
- return [
|
|
|
- 'width' => '130',
|
|
|
- ];
|
|
|
- },
|
|
|
- 'valueOther' => function($row) {
|
|
|
- return [
|
|
|
- 'tag'=>['type'=>(isset($row['ALLOW_TRANSFER']) && $row['ALLOW_TRANSFER']) ? 'Success' : 'Info', 'size' => 'small']
|
|
|
- ];
|
|
|
- },
|
|
|
- ],
|
|
|
];
|
|
|
}
|
|
|
return $this->columns;
|
|
|
@@ -350,53 +185,12 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
|
|
|
$this->filterTypes = [
|
|
|
'USER_NAME'=> ['name'=> 'Member code'], // 会员编号
|
|
|
'REAL_NAME'=> ['name'=> 'Member name'], // 会员姓名
|
|
|
-// 'ALLOW_LOGIN'=> ['name'=> '允许登录', 'other'=> 'yesOrNo'],
|
|
|
'CREATED_AT'=> ['name'=> 'Joining Date', 'other'=> 'date'], // 加入日期
|
|
|
'PERIOD_AT'=> ['name'=> 'Joining Period'], // 加入期数
|
|
|
- 'DEC_LV_NAME'=> ['name'=> 'Real time membership level', 'other'=> 'decLevel'], // 实时会员级别
|
|
|
-// 'DEC_LV_UPDATED_AT'=> ['name'=> '实时调整日期', 'other'=> 'date'],
|
|
|
-// 'LAST_DEC_LV_NAME'=> ['name'=> '结算时会员级别', 'other'=> 'decLevel'],
|
|
|
- 'EMP_LV_NAME'=> ['name'=> 'Real time employment', 'other'=> 'empLevel'], // 实时聘级
|
|
|
- 'CROWN_LV_NAME'=> ['name'=> 'Real time Crown', 'other'=> 'crownLevel'], // 实时聘级
|
|
|
-// 'HIGHEST_EMP_LV_NAME'=> ['name'=> '历史最高聘级', 'other'=> 'empLevel'],
|
|
|
-// 'HIGHEST_EMP_LV_PERIOD'=> ['name'=> '首次达到历史最高聘级的期数'],
|
|
|
'REC_USER_NAME'=> ['name'=> 'Recommendation No'],//推荐编号
|
|
|
- 'CON_USER_NAME'=> ['name'=> 'Placement No'],//安置编号
|
|
|
- //'ID_TYPE'=> ['name'=> '证件类型', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> '身份证']]],
|
|
|
- 'ID_CARD'=> ['name'=> 'Identification Number'],//证件号码
|
|
|
-// 'SPOUSE_NAME'=> ['name'=> '配偶姓名'],
|
|
|
-// 'SPOUSE_IDCARD'=> ['name'=> '配偶身份证号'],
|
|
|
-// 'SYSTEM_NAME'=> ['name'=> '体系名称', 'other'=> 'systems'],
|
|
|
-// 'SUB_COM_NAME'=> ['name'=> '所属分公司', 'other'=> 'subCompany'],
|
|
|
'MOBILE'=> ['name'=> 'Phone Number'],//手机号码
|
|
|
-// 'TEL'=> ['name'=> '备用手机号码'],
|
|
|
- 'DEC_USER_NAME'=> ['name'=> 'Stockist Code'], // 所属报单中心编号
|
|
|
- 'IS_DEC'=> ['name'=> 'Declaration center or not', 'other'=> 'yesOrNo'],//是否报单中心
|
|
|
- 'IS_STUDIO'=> ['name'=> 'Studio or not', 'other'=> 'yesOrNo'],//是否工作室
|
|
|
- 'DEC_ROLE_NAME'=> ['name'=> 'Stockist Level', 'other'=> 'decRole'],//报单中心级别
|
|
|
-// 'OPEN_BANK_NAME'=> ['name'=> '开户银行', 'other'=> 'banks'],
|
|
|
-// 'BANK_AREA'=> ['name'=> '银行地区', 'other'=> 'area'],
|
|
|
-// 'BANK_ADDRESS'=> ['name'=> '开户地址'],
|
|
|
-// 'BANK_NO'=> ['name'=> '银行账号'],
|
|
|
-// 'SEX'=> ['name'=> '性别', 'other'=> 'sex'],
|
|
|
-// 'NATION_NAME'=> ['name'=> '民族', 'other'=> 'nations'],
|
|
|
'AREA'=> ['name'=> 'Common address', 'other'=> 'area'],//常用地址
|
|
|
'STATUS'=> ['name'=> 'Active status', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> 'locking'],['id'=> 1, 'name'=> 'activation']]],
|
|
|
-// 'STATUS'=> ['name'=> '激活状态', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> '锁定'],['id'=> 1, 'name'=> '激活']]],
|
|
|
-// 'ADDRESS'=> ['name'=> '身份证地址'],
|
|
|
-// 'IS_AUTO_WITHDRAW'=> [
|
|
|
-// 'isUserTable'=> false,
|
|
|
-// 'name'=> '提现方式',
|
|
|
-// 'other'=> 'select',
|
|
|
-// 'selectData'=> [['id'=> 0, 'name'=> '手动'], ['id'=> 1, 'name'=> '自动']]
|
|
|
-// ],
|
|
|
-// 'VERIFIED'=> ['name'=> '实名认证', 'other'=> 'yesOrNo'],
|
|
|
-// 'VERIFIED_AT'=> ['name'=> '实名认证日期', 'other'=> 'date'],
|
|
|
-// 'IS_DIRECT_SELLER'=> ['name'=> '是否直销员', 'other'=> 'yesOrNo'],
|
|
|
-// 'IS_SYSTEM_LEADER'=> ['name'=> '是否体系领导人', 'other'=> 'yesOrNo'],
|
|
|
-// 'IS_GROUP_LEADER'=> ['name'=> '是否团队领导人', 'other'=> 'yesOrNo'],
|
|
|
-// 'ALLOW_TRANSFER'=> ['name'=> '转账功能开启', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> '关闭'],['id'=> 1, 'name'=> '开启']]],
|
|
|
-// 'DEC_CLOSED'=> ['name'=> '是否关闭报单', 'other'=> 'yesOrNo'],
|
|
|
];
|
|
|
}
|
|
|
return $this->filterTypes;
|