IndexList.php 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. <?php
  2. namespace backendApi\modules\v1\models\lists\user;
  3. use common\helpers\Cache;
  4. use common\helpers\http\BackendToFrontendApi;
  5. use common\helpers\user\Info;
  6. use common\libs\dataList\DataListInterface;
  7. use common\models\DecRole;
  8. use common\models\OpenBank;
  9. use common\models\Region;
  10. use common\models\User;
  11. use common\models\UserInfo;
  12. use common\libs\dataList\column\DateTime;
  13. use common\libs\dataList\column\YesNo;
  14. use common\models\UserNetwork;
  15. use common\models\UserSystem;
  16. use Yii;
  17. class IndexList extends \common\libs\dataList\DataList implements DataListInterface
  18. {
  19. /**
  20. * 列表名称
  21. * @return string
  22. */
  23. public function getListName(){
  24. return '会员列表';
  25. }
  26. /**
  27. * 列表筛选到的数据
  28. */
  29. public function dataHandle()
  30. {
  31. $this->condition .= ' AND UN.USER_ID=UI.USER_ID AND UN.PARENT_UID=UI.CON_UID';
  32. $this->listData = User::lists($this->condition, $this->params, [
  33. 'select' => 'U.*,
  34. UI.USER_ID, UI.ZC_PV, UI.CON_UID, UI.REC_UID, UI.CON_NUM, UI.REC_NUM, UI.NETWORK_DEEP,
  35. UI.RELATION_DEEP, UI.SYSTEM_ID, UI.IS_GROUP_LEADER, UI.IS_SYSTEM_LEADER, UI.IS_TEAM, UI.IS_BIND,
  36. UI.IS_TEAM_MAIN, UI.IS_BIND_MAIN, UI.IS_AUTO_WITHDRAW, UI.CLOSE_LOGIN, UI.REG_TYPE, UI.SHOULD_REG_TYPE,
  37. UI.REG_NAME, UI.CREDIT_CODE, UI.PREMISES, UI.LEGAL_PERSON, UI.REG_EXPIRES, UI.STORE_TYPE, UI.INVOICE_BALANCE,
  38. UI.HIGHEST_EMP_LV, UI.CLOSE_LOGIN_AT, UI.PULLED_AT,
  39. UI.GROUP_LEADER_AT, UI.ALLOW_TRANSFER, UI.ALLOW_RECONSUME_SMS, UI.ALLOW_RECONSUME_SMS_TO,
  40. UI.HIGHEST_EMP_LV_PERIOD, UI.TRANSFER_PROP, UI.LOGIN_NUMS, UI.FAIL_NUMS, UI.LAST_LOGIN_IP,
  41. UI.LAST_LOGIN_AT, UI.SHOW_EMP_LV,UN.RELATIVE_LOCATION,
  42. CU.USER_NAME CON_USER_NAME,CU.REAL_NAME CON_REAL_NAME,
  43. RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,
  44. DU.USER_NAME DEC_USER_NAME
  45. ',
  46. 'orderBy' => 'UI.CREATED_AT DESC, UI.ID DESC',
  47. 'from' => User::tableName() . ' AS U',
  48. 'join' => [
  49. ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'UI.USER_ID=U.ID'],
  50. ['LEFT JOIN', UserNetwork::tableName() . ' AS UN', 'UI.USER_ID=UN.USER_ID'],
  51. ['LEFT JOIN', User::tableName() . ' AS CU', 'UI.CON_UID=CU.ID'],
  52. ['LEFT JOIN', User::tableName() . ' AS RU', 'UI.REC_UID=RU.ID'],
  53. ['LEFT JOIN', User::tableName() . ' AS DU', 'U.DEC_ID=DU.ID'],
  54. ],
  55. 'page' => $this->page,
  56. 'pageSize' => $this->pageSize,
  57. ]);
  58. foreach ($this->listData['list'] as $key => $value) {
  59. // 后台访问前台的请求参数
  60. if (!$this->isExport && Yii::$app->user->validateAdminAction('user', 'login-to-frontend')) {
  61. $urlParams = BackendToFrontendApi::paramsFormat(['id' => $value['USER_ID']]);
  62. $urlParamStr = '';
  63. foreach ($urlParams as $pKey => $pValue) {
  64. $urlParamStr .= $pKey . '=' . $pValue . '&';
  65. }
  66. $urlParamStr = substr($urlParamStr, 0, -1);
  67. $this->listData['list'][$key]['BTF_URL'] = $urlParamStr;
  68. } else {
  69. $this->listData['list'][$key]['BTF_URL'] = null;
  70. }
  71. }
  72. }
  73. /**
  74. * 要展示和导出的所有字段
  75. * @return array
  76. */
  77. public function getColumn(){
  78. $decLevelConfig = Cache::getDecLevelConfig();
  79. $empLevelConfig = Cache::getEmpLevelConfig();
  80. $decRoleConfig = DecRole::getAllData();
  81. $systemConfig = UserSystem::getAllSystems();
  82. $openBankConfig = OpenBank::getAllOpenBank();
  83. $regionConfig = Cache::getRegionConfig();
  84. if(!$this->columns){
  85. $this->columns = [
  86. 'USER_ID' => null, // 这种传输方式主要是用于索引,因为过滤后的字段可能没有这种ID,但是一些功能的操作还需要用这种ID去关联,例如前台会员列表中的勾选批量状态管理,这里需要的就是USER_ID
  87. 'BTF_URL' => null,
  88. 'USER_NAME' => [
  89. 'header' => 'Member code',//会员编号
  90. 'headerOther' => ['width' => '150'],
  91. ],
  92. 'REAL_NAME' => [
  93. 'header' => 'Member name',//会员姓名
  94. 'headerOther' => [
  95. 'width' => '120',
  96. ],
  97. 'valueOther' => [
  98. 'tag'=>['type'=>'success', 'size' => 'small', 'class'=>'no-border']
  99. ],
  100. ],
  101. 'LOGIN_STATUS_NAME' => [
  102. 'header' => 'Login status',//登录状态
  103. 'value' => function($row) {
  104. return $row['ALLOW_LOGIN'] == 1 ? 'allow Login': 'prohibit Login';//'允许登录' : '禁止登录'
  105. },
  106. 'headerOther' => ['width' => '110'],
  107. ],
  108. 'STATUS' => [
  109. 'header' => 'status',//状态
  110. 'value' => function($row) {
  111. return $row['STATUS'] == 1 ? 'activate': 'lock';//'激活' : '锁定'
  112. },
  113. 'headerOther' => ['width' => '110'],
  114. ],
  115. 'ALLOW_LOGIN' => ['header' => 'Filter allow login','hidden'=>true],//筛选允许登录
  116. 'CREATED_AT' => [
  117. 'header' => 'Date of accession',//加入日期
  118. 'value' => function($row) {
  119. return (new DateTime([
  120. 'value' => $row['CREATED_AT'],
  121. ]))->result();
  122. },
  123. 'headerOther' => ['width' => '170'],
  124. ],
  125. 'PERIOD_AT' => 'Number of joining periods',//加入期数
  126. 'DEC_LV_NAME' => [
  127. 'header' => 'Real time membership level',//实时会员级别
  128. 'headerOther' => [
  129. 'width' => '110',
  130. ],
  131. 'value' => function($row) use($decLevelConfig) {
  132. return $decLevelConfig[$row['DEC_LV']]['LEVEL_NAME'];
  133. },
  134. 'valueOther' => [
  135. 'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
  136. ],
  137. ],
  138. 'DEC_LV_UPDATED_AT' => [
  139. 'header' => 'Real time adjustment date',//实时调整日期
  140. 'value' => function($row) {
  141. return (new DateTime([
  142. 'value' => $row['DEC_LV_UPDATED_AT'],
  143. ]))->result();
  144. },
  145. 'headerOther' => ['width' => '170'],
  146. ],
  147. 'LAST_DEC_LV_NAME' => [
  148. 'header' => 'Member level at settlement',//结算时会员级别
  149. 'headerOther' => [
  150. 'width' => '120',
  151. ],
  152. 'value' => function($row) use($decLevelConfig) {
  153. if (!$row['LAST_DEC_LV']) {
  154. return $decLevelConfig[$row['DEC_LV']]['LEVEL_NAME'];
  155. } else {
  156. return $decLevelConfig[$row['LAST_DEC_LV']]['LEVEL_NAME'];
  157. }
  158. },
  159. 'valueOther' => [
  160. 'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
  161. ],
  162. ],
  163. 'EMP_LV_NAME' => [
  164. 'header' => 'Real time employment',//实时聘级
  165. 'headerOther' => [
  166. 'width' => '130',
  167. ],
  168. 'value' => function($row) use($empLevelConfig) {
  169. return isset($empLevelConfig[$row['EMP_LV']])?$empLevelConfig[$row['EMP_LV']]['LEVEL_NAME']:'';
  170. },
  171. 'valueOther' => [
  172. 'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
  173. ],
  174. ],
  175. // 'HIGHEST_EMP_LV_NAME' => [
  176. // 'header' => '历史最高聘级',
  177. // 'value' => function($row) use($empLevelConfig) {
  178. // if (!$row['HIGHEST_EMP_LV']){
  179. // return $empLevelConfig[$row['EMP_LV']]['LEVEL_NAME'];
  180. // } else {
  181. // return $empLevelConfig[$row['HIGHEST_EMP_LV']]['LEVEL_NAME'];
  182. // }
  183. // },
  184. // 'headerOther' => ['width' => '130'],
  185. // ],
  186. // 'HIGHEST_EMP_LV_PERIOD' => [
  187. // 'header' => '首次达到历史最高聘级的期数',
  188. // 'headerOther' => ['width' => '210'],
  189. // ],
  190. 'REC_USER_NAME' => [
  191. 'header' => 'Recommendation No',//推荐编号
  192. 'headerOther' => ['width' => '150'],
  193. ],
  194. 'REC_REAL_NAME' => [
  195. 'header' => 'Recommended name',//推荐姓名
  196. 'headerOther' => ['width' => '100'],
  197. ],
  198. 'CON_USER_NAME' => [
  199. 'header' => 'Placement No',//安置编号
  200. 'headerOther' => ['width' => '150'],
  201. ],
  202. 'CON_REAL_NAME' => [
  203. 'header' => 'Placement name',//安置姓名
  204. 'headerOther' => ['width' => '100'],
  205. ],
  206. 'RELATIVE_LOCATION' => [
  207. 'header' => 'Resettlement area',//安置区域
  208. 'headerOther' => ['width' => '100'],
  209. ],
  210. // 'ID_TYPE' => [
  211. // 'header' => 'Document type',//证件类型
  212. // 'value' => function($row) {
  213. // return $row['ID_TYPE'] == 0 ? 'Identity No.' : '';//'身份证' : ''
  214. // },
  215. // ],
  216. // 'ID_CARD' => [
  217. // 'header' => 'Identification Number',//证件号码
  218. // 'value' => function($row) {
  219. // return "\t".$row['ID_CARD'];
  220. // },
  221. // 'headerOther' => ['width' => '180'],
  222. // ],
  223. // 'SPOUSE_NAME' => [
  224. // 'header' => '配偶姓名',
  225. // 'headerOther' => ['width' => '100'],
  226. // ],
  227. // 'SPOUSE_IDCARD' => [
  228. // 'header' => '配偶身份证号',
  229. // 'value' => function($row) {
  230. // return "\t".$row['SPOUSE_IDCARD'];
  231. // },
  232. // 'headerOther' => ['width' => '180'],
  233. // ],
  234. // 'SYSTEM_NAME' => [
  235. // 'header' => '体系名称',
  236. // 'headerOther' => ['width' => '150'],
  237. // 'value' => function($row) use($systemConfig) {
  238. // return $systemConfig[$row['SYSTEM_ID']]['SYSTEM_NAME'] ?? '';
  239. // },
  240. // ],
  241. 'MOBILE' => [
  242. 'header' => 'phone number',//手机号码
  243. 'value' => function($row) {
  244. return "\t".$row['MOBILE'];
  245. },
  246. 'headerOther' => ['width' => '120'],
  247. ],
  248. 'TEL' => [
  249. 'header' => 'Alternate Phone number​',//备用手机号码
  250. 'value' => function($row) {
  251. return "\t".$row['TEL'];
  252. },
  253. 'headerOther' => ['width' => '120'],
  254. ],
  255. 'DEC_USER_NAME' => [
  256. 'header' => 'No. of reporting center',//所属报单中心编号
  257. 'headerOther' => ['width' => '150'],
  258. ],
  259. 'IS_DEC' => [
  260. 'header' => 'Declaration center or not',//是否报单中心
  261. 'value' => function($row) {
  262. return (new YesNo([
  263. 'value' => $row['IS_DEC'],
  264. ]))->result();
  265. },
  266. 'headerOther' => function($row) {
  267. return [
  268. 'width' => '120',
  269. ];
  270. },
  271. 'valueOther' => function($row) {
  272. return [
  273. 'tag'=>['type'=>(isset($row['IS_DEC']) && $row['IS_DEC'] )? 'success' : 'info', 'size' => 'small']
  274. ];
  275. },
  276. ],
  277. 'IS_STUDIO' => [
  278. 'header' => 'Studio or not',//是否工作室
  279. 'value' => function($row) {
  280. return (new YesNo([
  281. 'value' => $row['IS_STUDIO'],
  282. ]))->result();
  283. },
  284. 'headerOther' => function($row) {
  285. return [
  286. 'width' => '120',
  287. ];
  288. },
  289. 'valueOther' => function($row) {
  290. return [
  291. 'tag'=>['type'=>(isset($row['IS_STUDIO']) && $row['IS_STUDIO'] )? 'success' : 'info', 'size' => 'small']
  292. ];
  293. },
  294. ],
  295. 'IS_ATLAS' => [
  296. 'header' => 'Whether the atlas is displayed',//是否显示图谱
  297. 'value' => function($row) {
  298. return (new YesNo([
  299. 'value' => $row['IS_ATLAS'],
  300. ]))->result();
  301. },
  302. 'headerOther' => function($row) {
  303. return [
  304. 'width' => '120',
  305. ];
  306. },
  307. 'valueOther' => function($row) {
  308. return [
  309. 'tag'=>['type'=>(isset($row['IS_ATLAS']) && $row['IS_ATLAS'] )? 'success' : 'info', 'size' => 'small']
  310. ];
  311. },
  312. ],
  313. 'IS_RECHARGE' => [
  314. 'header' => 'Whether to display recharge',//是否显示充值
  315. 'value' => function($row) {
  316. return (new YesNo([
  317. 'value' => $row['IS_RECHARGE'],
  318. ]))->result();
  319. },
  320. 'headerOther' => function($row) {
  321. return [
  322. 'width' => '120',
  323. ];
  324. },
  325. 'valueOther' => function($row) {
  326. return [
  327. 'tag'=>['type'=>(isset($row['IS_RECHARGE']) && $row['IS_RECHARGE'] )? 'success' : 'info', 'size' => 'small']
  328. ];
  329. },
  330. ],
  331. 'DEC_ROLE_NAME' => [
  332. 'header' => 'Entry center level',//报单中心级别
  333. 'headerOther' => ['width' => '110'],
  334. 'value' => function($row) use($decRoleConfig) {
  335. return $decRoleConfig[$row['DEC_ROLE_ID']]['ROLE_NAME'] ?? '';
  336. },
  337. ],
  338. 'OPEN_BANK_NAME' => [
  339. 'header' => 'Deposit bank',//开户银行
  340. 'headerOther' => ['width' => '110'],
  341. 'value' => function($row) use($openBankConfig) {
  342. return $openBankConfig[$row['OPEN_BANK']]['BANK_NAME'] ?? '';
  343. },
  344. ],
  345. // 'BANK_AREA' => [
  346. // 'header' => 'Banking region',//银行地区
  347. // 'value' => function($row) use($regionConfig) {
  348. // $province = $regionConfig[$row['BANK_PROVINCE']]['REGION_NAME'] ?? '';
  349. // $city = $regionConfig[$row['BANK_CITY']]['REGION_NAME'] ?? '';
  350. // $county = $regionConfig[$row['BANK_COUNTY']]['REGION_NAME'] ?? '';
  351. // return $province.$city.$county;
  352. // },
  353. // 'showValue' => function($row) use($regionConfig) {
  354. // $province = $regionConfig[$row['BANK_PROVINCE']]['REGION_NAME'] ?? '';
  355. // $city = $regionConfig[$row['BANK_CITY']]['REGION_NAME'] ?? '';
  356. // $county = $regionConfig[$row['BANK_COUNTY']]['REGION_NAME'] ?? '';
  357. // return '<div class="addr" title='.$province.$city.$county.'>'.$province.$city.$county.'</div>';
  358. // },
  359. // 'headerOther' => [
  360. // 'width' => '200'
  361. // ],
  362. // ],
  363. // 'BANK_ADDRESS' => [
  364. // 'header' => 'Account opening address',//开户地址
  365. // 'headerOther' => ['width' => '250'],
  366. // 'showValue' => function($row) {
  367. // return '<div class="addr" title='.$row['BANK_ADDRESS'].'>'.$row['BANK_ADDRESS'].'</div>';
  368. // },
  369. // ],
  370. 'BANK_NO' => [
  371. 'header' => 'Bank account number',//银行帐号
  372. 'headerOther' => ['width' => '220'],
  373. 'value' => function($row) {
  374. return "\t".$row['BANK_NO'];
  375. },
  376. ],
  377. 'SEX' => 'Gender',//性别
  378. // 'NATION_NAME' => [
  379. // 'header' => 'nation',//民族
  380. // 'value' => function($row) {
  381. // return \Yii::$app->params['nation'][$row['NATION']]['name'] ?? '';
  382. // },
  383. // ],
  384. 'AREA' => [
  385. 'header' => 'Common address',//常用地址
  386. 'value' => function($row) use($regionConfig) {
  387. $province = $regionConfig[$row['PROVINCE']]['REGION_NAME'] ?? '';
  388. $city = $regionConfig[$row['CITY']]['REGION_NAME'] ?? '';
  389. $county = $regionConfig[$row['COUNTY']]['REGION_NAME'] ?? '';
  390. return $province.$city.$county;
  391. },
  392. 'showValue' => function($row) {
  393. $province = $regionConfig[$row['PROVINCE']]['REGION_NAME'] ?? '';
  394. $city = $regionConfig[$row['CITY']]['REGION_NAME'] ?? '';
  395. $county = $regionConfig[$row['COUNTY']]['REGION_NAME'] ?? '';
  396. return '<div class="addr" title='.$province.$city.$county.'>'.$province.$city.$county.'</div>';
  397. },
  398. 'headerOther' => [
  399. 'width' => '200'
  400. ],
  401. ],
  402. 'ADDRESS' => [
  403. 'header' => 'ID card address',//身份证地址
  404. 'value' => function($row) {
  405. return $row['ADDRESS'];
  406. },
  407. 'showValue' => function($row) {
  408. return '<div class="addr" title='.$row['ADDRESS'].'>'.$row['ADDRESS'].'</div>';
  409. },
  410. 'headerOther' => ['width' => '250'],
  411. ],
  412. // 'IS_AUTO_WITHDRAW' => [
  413. // 'header' => '提现方式',
  414. // 'value' => function($row) {
  415. // return $row['IS_AUTO_WITHDRAW']==0?'手动':'自动';
  416. // },
  417. // ],
  418. 'VERIFIED' => [
  419. 'header' => 'Real name authentication',//实名认证
  420. 'value' => function($row) {
  421. return (new YesNo([
  422. 'value' => $row['VERIFIED'],
  423. ]))->result();
  424. },
  425. 'headerOther' => function($row) {
  426. return [
  427. 'width' => '120',
  428. ];
  429. },
  430. 'valueOther' => function($row) {
  431. return [
  432. 'tag'=>['type'=>(isset($row['VERIFIED']) && $row['VERIFIED']) ? 'success' : 'info', 'size' => 'small']
  433. ];
  434. },
  435. ],
  436. 'VERIFIED_AT' => [
  437. 'header' => 'Real name certification date',//实名认证日期
  438. 'value' => function($row) {
  439. return (new DateTime([
  440. 'value' => $row['VERIFIED_AT'],
  441. ]))->result();
  442. },
  443. 'headerOther' => ['width' => '170'],
  444. ],
  445. // 'IS_DIRECT_SELLER' => [
  446. // 'header' => '是否直销员',
  447. // 'value' => function($row) {
  448. // return (new YesNo([
  449. // 'value' => $row['IS_DIRECT_SELLER'],
  450. // ]))->result();
  451. // },
  452. // 'valueOther' => function($row) {
  453. // return [
  454. // 'tag'=>['type'=>(isset($row['IS_DIRECT_SELLER']) && $row['IS_DIRECT_SELLER']) ? 'success' : 'info', 'size' => 'small']
  455. // ];
  456. // },
  457. // 'headerOther' => function($row) {
  458. // return [
  459. // 'width' => '120',
  460. // ];
  461. // },
  462. // ],
  463. // 'IS_SYSTEM_LEADER' => [
  464. // 'header' => '是否体系领导人',
  465. // 'value' => function($row) {
  466. // return (new YesNo([
  467. // 'value' => $row['IS_SYSTEM_LEADER'],
  468. // ]))->result();
  469. // },
  470. // 'headerOther' => function($row) {
  471. // return [
  472. // 'width' => '120',
  473. // ];
  474. // },
  475. // 'valueOther' => function($row) {
  476. // return [
  477. // 'tag'=>['type'=>(isset($row['IS_SYSTEM_LEADER']) && $row['IS_SYSTEM_LEADER']) ? 'success' : 'info', 'size' => 'small']
  478. // ];
  479. // },
  480. // ],
  481. // 'IS_GROUP_LEADER' => [
  482. // 'header' => '是否团队领导人',
  483. // 'value' => function($row) {
  484. // return (new YesNo([
  485. // 'value' => $row['IS_GROUP_LEADER'],
  486. // ]))->result();
  487. // },
  488. // 'headerOther' => function($row) {
  489. // return [
  490. // 'width' => '120',
  491. // ];
  492. // },
  493. // 'valueOther' => function($row) {
  494. // return [
  495. // 'tag'=>['type'=>(isset($row['IS_GROUP_LEADER']) && $row['IS_GROUP_LEADER'] ) ? 'success' : 'info', 'size' => 'small']
  496. // ];
  497. // },
  498. // ],
  499. 'BIRTHDAY' => [
  500. 'header' => 'birthday',//生日
  501. 'value' => function($row) {
  502. return date('Y-m-d', strtotime($row['BIRTHDAY']));
  503. },
  504. 'headerOther' => ['width' => '110'],
  505. ],
  506. 'ALLOW_TRANSFER' => [
  507. 'header' => 'Transfer function enabled',//转账功能开启
  508. 'value' => function($row) {
  509. return $row['ALLOW_TRANSFER'] == 1 ? 'on': 'off';//'开启' : '关闭'
  510. },
  511. 'headerOther' => function($row) {
  512. return [
  513. 'width' => '120',
  514. ];
  515. },
  516. 'valueOther' => function($row) {
  517. return [
  518. 'tag'=>['type'=>(isset($row['ALLOW_TRANSFER']) && $row['ALLOW_TRANSFER']) ? 'success' : 'info', 'size' => 'small']
  519. ];
  520. },
  521. ],
  522. 'DEC_CLOSED' => [
  523. 'header' => 'Close entry',//是否关闭报单
  524. 'value' => function($row) {
  525. return (new YesNo([
  526. 'value' => $row['DEC_CLOSED'],
  527. ]))->result();
  528. },
  529. 'headerOther' => function($row) {
  530. return [
  531. 'width' => '120',
  532. ];
  533. },
  534. 'valueOther' => function($row) {
  535. return [
  536. 'tag'=>['type'=>(isset($row['DEC_CLOSED']) && $row['DEC_CLOSED']) ? 'info' : 'success', 'size' => 'small']
  537. ];
  538. },
  539. ],
  540. 'IS_MODIFY_PASSWORD' => [
  541. 'header' => 'Password modification status',//密码修改状态
  542. 'value' => function($row) {
  543. return $row['IS_MODIFY_PASSWORD'] == 1 ? 'on': 'off';//'开启' : '关闭'
  544. },
  545. 'headerOther' => function($row) {
  546. return [
  547. 'width' => '120',
  548. ];
  549. },
  550. 'valueOther' => function($row) {
  551. return [
  552. 'tag'=>['type'=>(isset($row['IS_MODIFY_PASSWORD']) && $row['IS_MODIFY_PASSWORD'] )? 'success' : 'info', 'size' => 'small']
  553. ];
  554. },
  555. ],
  556. ];
  557. }
  558. return $this->columns;
  559. }
  560. /**
  561. * 前台用于筛选的类型集合
  562. * @return mixed
  563. */
  564. public function getFilterTypes()
  565. {
  566. if(!$this->filterTypes){
  567. $this->filterTypes = [
  568. 'USER_NAME'=> ['name'=> 'Member code'],//会员编号
  569. 'REAL_NAME'=> ['name'=> 'Member name'],//会员姓名
  570. // 'ALLOW_LOGIN'=> ['name'=> '允许登录', 'other'=> 'yesOrNo'],
  571. 'CREATED_AT'=> ['name'=> 'Date of accession', 'other'=> 'date'],//加入日期
  572. 'PERIOD_AT'=> ['name'=> 'Number of joining periods'],//加入期数
  573. 'DEC_LV_NAME'=> ['name'=> 'Real time membership level', 'other'=> 'decLevel'],//实时会员级别
  574. // 'DEC_LV_UPDATED_AT'=> ['name'=> '实时调整日期', 'other'=> 'date'],
  575. // 'LAST_DEC_LV_NAME'=> ['name'=> '结算时会员级别', 'other'=> 'decLevel'],
  576. 'EMP_LV_NAME'=> ['name'=> 'Real time employment', 'other'=> 'empLevel'],//实时聘级
  577. // 'HIGHEST_EMP_LV_NAME'=> ['name'=> '历史最高聘级', 'other'=> 'empLevel'],
  578. // 'HIGHEST_EMP_LV_PERIOD'=> ['name'=> '首次达到历史最高聘级的期数'],
  579. 'REC_USER_NAME'=> ['name'=> 'Recommendation No'],//推荐编号
  580. 'CON_USER_NAME'=> ['name'=> 'Placement No'],//安置编号
  581. //'ID_TYPE'=> ['name'=> '证件类型', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> '身份证']]],
  582. 'ID_CARD'=> ['name'=> 'Identification Number'],//证件号码
  583. // 'SPOUSE_NAME'=> ['name'=> '配偶姓名'],
  584. // 'SPOUSE_IDCARD'=> ['name'=> '配偶身份证号'],
  585. // 'SYSTEM_NAME'=> ['name'=> '体系名称', 'other'=> 'systems'],
  586. // 'SUB_COM_NAME'=> ['name'=> '所属分公司', 'other'=> 'subCompany'],
  587. 'MOBILE'=> ['name'=> 'phone number'],//手机号码
  588. // 'TEL'=> ['name'=> '备用手机号码'],
  589. 'DEC_USER_NAME'=> ['name'=> 'No. of reporting center'],//所属报单中心编号
  590. 'IS_DEC'=> ['name'=> 'Declaration center or not', 'other'=> 'yesOrNo'],//是否报单中心
  591. 'IS_STUDIO'=> ['name'=> 'Studio or not', 'other'=> 'yesOrNo'],//是否工作室
  592. 'DEC_ROLE_NAME'=> ['name'=> 'Entry center level', 'other'=> 'decRole'],//报单中心级别
  593. // 'OPEN_BANK_NAME'=> ['name'=> '开户银行', 'other'=> 'banks'],
  594. // 'BANK_AREA'=> ['name'=> '银行地区', 'other'=> 'area'],
  595. // 'BANK_ADDRESS'=> ['name'=> '开户地址'],
  596. // 'BANK_NO'=> ['name'=> '银行账号'],
  597. // 'SEX'=> ['name'=> '性别', 'other'=> 'sex'],
  598. // 'NATION_NAME'=> ['name'=> '民族', 'other'=> 'nations'],
  599. 'AREA'=> ['name'=> 'Common address', 'other'=> 'area'],//常用地址
  600. 'STATUS'=> ['name'=> 'Active status', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> 'locking'],['id'=> 1, 'name'=> 'activation']]],
  601. // 'STATUS'=> ['name'=> '激活状态', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> '锁定'],['id'=> 1, 'name'=> '激活']]],
  602. // 'ADDRESS'=> ['name'=> '身份证地址'],
  603. // 'IS_AUTO_WITHDRAW'=> [
  604. // 'isUserTable'=> false,
  605. // 'name'=> '提现方式',
  606. // 'other'=> 'select',
  607. // 'selectData'=> [['id'=> 0, 'name'=> '手动'], ['id'=> 1, 'name'=> '自动']]
  608. // ],
  609. // 'VERIFIED'=> ['name'=> '实名认证', 'other'=> 'yesOrNo'],
  610. // 'VERIFIED_AT'=> ['name'=> '实名认证日期', 'other'=> 'date'],
  611. // 'IS_DIRECT_SELLER'=> ['name'=> '是否直销员', 'other'=> 'yesOrNo'],
  612. // 'IS_SYSTEM_LEADER'=> ['name'=> '是否体系领导人', 'other'=> 'yesOrNo'],
  613. // 'IS_GROUP_LEADER'=> ['name'=> '是否团队领导人', 'other'=> 'yesOrNo'],
  614. // 'ALLOW_TRANSFER'=> ['name'=> '转账功能开启', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> '关闭'],['id'=> 1, 'name'=> '开启']]],
  615. // 'DEC_CLOSED'=> ['name'=> '是否关闭报单', 'other'=> 'yesOrNo'],
  616. ];
  617. }
  618. return $this->filterTypes;
  619. }
  620. }