IndexList.php 31 KB

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