AdminHandleList.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <?php
  2. namespace backendApi\modules\v1\models\lists\log;
  3. use common\helpers\MongodbSearchFilter;
  4. use common\libs\dataList\DataListInterface;
  5. use common\libs\dataList\column\DateTime;
  6. use common\models\LogAdminHandle;
  7. class AdminHandleList extends \common\libs\dataList\DataList implements DataListInterface
  8. {
  9. /**
  10. * 列表名称
  11. * @return string
  12. */
  13. public function getListName(){
  14. return \Yii::t('ctx', 'adminLoginLog');
  15. }
  16. /**
  17. * 列表筛选到的数据
  18. * @throws \yii\base\Exception
  19. */
  20. public function dataHandle()
  21. {
  22. $filter = MongodbSearchFilter::filterCondition([
  23. 'opt_type' => 'opt_type',
  24. 'opt_obj_name' => 'opt_obj_name',
  25. 'remark' => 'remark',
  26. 'admin_name' => 'admin_name',
  27. 'created_at' => 'created_at',
  28. 'period_num' => 'period_num',
  29. 'ip' => 'ip',
  30. 'device' => 'device',
  31. 'user_agent' => 'user_agent',
  32. 'request_route' => 'request_route',
  33. ]);
  34. $this->listData = LogAdminHandle::lists($filter['condition'], []);
  35. }
  36. /**
  37. * 要展示和导出的所有字段
  38. * @return array
  39. */
  40. public function getColumn(){
  41. if(!$this->columns){
  42. $this->columns = [
  43. 'save_before_content' => null,
  44. 'save_after_content' => null,
  45. 'opt_type' => [
  46. 'header' => \Yii::t('ctx', 'operatingType'),
  47. 'headerOther' => [
  48. 'width' => '200',
  49. ],
  50. 'valueOther' => function($row) {
  51. return [
  52. 'tag'=>['type'=>'success', 'size' => 'small']
  53. ];
  54. },
  55. ],
  56. 'opt_obj_name' => [
  57. 'header' => \Yii::t('ctx', 'operationObjectNumber'),
  58. 'headerOther' => [
  59. 'width' => '150',
  60. ],
  61. ],
  62. 'remark' => [
  63. 'header' => \Yii::t('ctx', 'remarks'),
  64. 'headerOther' => [
  65. 'width' => '120',
  66. 'show-overflow-tooltip'=>true,
  67. 'min-width'=>'200',
  68. ],
  69. ],
  70. 'admin_name' => [
  71. 'header' => \Yii::t('ctx', 'operator'),
  72. 'headerOther' => [
  73. 'width' => '130',
  74. ],
  75. ],
  76. 'created_at' => [
  77. 'header' => \Yii::t('ctx', 'operatingTime'),
  78. 'value' => function($row) {
  79. return (new DateTime([
  80. 'value' => $row['created_at'],
  81. ]))->result();
  82. },
  83. 'headerOther' => ['width' => '180'],
  84. ],
  85. 'period_num' => [
  86. 'header' => \Yii::t('ctx', 'numberOfPhases'),
  87. 'headerOther' => [
  88. 'width' => '150',
  89. ],
  90. ],
  91. 'ip' => [
  92. 'header' => \Yii::t('ctx', 'IPAddress'),
  93. 'headerOther' => [
  94. 'width' => '150',
  95. ],
  96. ],
  97. 'device' => [
  98. 'header' => \Yii::t('ctx', 'client'),
  99. 'headerOther' => [
  100. 'width' => '150',
  101. ],
  102. ],
  103. 'user_agent' => [
  104. 'header' => \Yii::t('ctx', 'operatingSystem'),
  105. 'headerOther' => [
  106. 'width' => '950',
  107. ],
  108. ],
  109. 'request_route' => [
  110. 'header' => \Yii::t('ctx', 'requestPath'),
  111. 'headerOther' => [
  112. 'width' => '250',
  113. ],
  114. ],
  115. ];
  116. }
  117. return $this->columns;
  118. }
  119. /**
  120. * 前台用于筛选的类型集合
  121. * @return mixed
  122. */
  123. public function getFilterTypes()
  124. {
  125. if(!$this->filterTypes){
  126. $selectData = [
  127. ['id'=>'更新期数配置','name'=>\Yii::t('ctx', 'updateNumberOfPhasesConfig')],
  128. ['id'=>'更新级别奖金配置','name'=>\Yii::t('ctx', 'updateLevelBonusConfig')],
  129. ['id'=>'更新奖金配置','name'=>\Yii::t('ctx', 'updateBonusConfig')],
  130. ['id'=>'更新聘级奖金配置','name'=>\Yii::t('ctx', 'updateRankBonusConfig')],
  131. ['id'=>'更新转账配置','name'=>\Yii::t('ctx', 'updateTransferConfig')],
  132. ['id'=>'申请变动会员余额','name'=>\Yii::t('ctx', 'requestChangeUserBalance')],
  133. ['id'=>'审核会员余额','name'=>\Yii::t('ctx', 'checkUserBalance')],
  134. ['id'=>'批量申请变动会员余额','name'=>\Yii::t('ctx', 'batchRequestChangeUserBalance')],
  135. ['id'=>'空单录入','name'=>\Yii::t('ctx', 'blankEntry')],
  136. ['id'=>'删除空单会员','name'=>\Yii::t('ctx', 'delBlankUser')],
  137. ['id'=>'修改会员级别','name'=>\Yii::t('ctx', 'changeUserLevel')],
  138. ['id'=>'申请调整会员业绩','name'=>\Yii::t('ctx', 'applyAdjustmentUserPerformance')],
  139. ['id'=>'申请修改会员状态','name'=>\Yii::t('ctx', 'applyModifyUserStatus')],
  140. ['id'=>'设置团队领导人','name'=>\Yii::t('ctx', 'setTeamLeaders')],
  141. //['id'=>'申请修改会员状态','name'=>'申请修改会员状态'],
  142. ['id'=>'审核会员状态','name'=>\Yii::t('ctx', 'checkUserStatus')],
  143. ['id'=>'显示图谱','name'=>\Yii::t('ctx', 'displayMap')],
  144. ['id'=>'隐藏图谱','name'=>\Yii::t('ctx', 'hiddenMap')],
  145. ['id'=>'设置报单中心','name'=>\Yii::t('ctx', 'setDeclarationCenter')],
  146. ['id'=>'取消报单中心','name'=>\Yii::t('ctx', 'cancelDeclarationCenter')],
  147. ['id'=>'会员激活','name'=>\Yii::t('ctx', 'userActivation')],
  148. ['id'=>'会员锁定','name'=>\Yii::t('ctx', 'userLocking')],
  149. ['id'=>'修改会员资料','name'=>\Yii::t('ctx', 'modifyUserInfo')],
  150. ['id'=>'编辑管理员','name'=>\Yii::t('ctx', 'editAdmin')],
  151. ['id'=>'申请移网','name'=>\Yii::t('ctx', 'applyRemoveNetwork')],
  152. ['id'=>'审核通过移网','name'=>\Yii::t('ctx', 'approveRemoveNetwork')],
  153. ['id'=>'重置密码','name'=>\Yii::t('ctx', 'resetPasswords')],
  154. ['id'=>'撤销体系','name'=>\Yii::t('ctx', 'cancellationSystem')],
  155. ['id'=>'添加体系','name'=>\Yii::t('ctx', 'addSystem')],
  156. ['id'=>'编辑体系','name'=>\Yii::t('ctx', 'editSystem')],
  157. ['id'=>'恢复体系','name'=>\Yii::t('ctx', 'recoverySystem')],
  158. ['id'=>'perf adjustment','name'=>'perf adjustment'],
  159. ['id'=>'调整订单期数','name'=>\Yii::t('ctx', 'shopOrderPeriodAdjust')],
  160. ];
  161. $this->filterTypes = [
  162. 'opt_type' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'operatingType'), 'other'=> 'select', 'selectData'=> $selectData],
  163. 'opt_obj_name' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'operationObjectNumber')],
  164. 'remark' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'remarks')],
  165. 'admin_name' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'operator')],
  166. 'created_at' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'operatingTime'), 'other'=> 'date'],
  167. 'period_num' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'numberOfPhases')],
  168. 'ip' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'IPAddress')],
  169. 'device' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'client')],
  170. 'user_agent' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'operatingSystem')],
  171. 'request_route' => ['isUserTable'=>false, 'name'=>\Yii::t('ctx', 'requestPath')],
  172. ];
  173. }
  174. return $this->filterTypes;
  175. }
  176. }