UserHandleList.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. use common\models\LogSystem;
  8. use common\models\LogUserHandle;
  9. use common\models\LogUserLogin;
  10. class UserHandleList extends \common\libs\dataList\DataList implements DataListInterface
  11. {
  12. /**
  13. * 列表名称
  14. * @return string
  15. */
  16. public function getListName(){
  17. return '会员操作日志';
  18. }
  19. /**
  20. * 列表筛选到的数据
  21. * @throws \yii\base\Exception
  22. */
  23. public function dataHandle()
  24. {
  25. $filter = MongodbSearchFilter::filterCondition([
  26. 'opt_type' => 'opt_type',
  27. 'opt_obj_name' => 'opt_obj_name',
  28. 'remark' => 'remark',
  29. 'user_name' => 'admin_name',
  30. 'created_at' => 'created_at',
  31. 'period_num' => 'period_num',
  32. 'ip' => 'ip',
  33. 'device' => 'device',
  34. 'user_agent' => 'user_agent',
  35. 'request_route' => 'request_route',
  36. ]);
  37. $this->listData = LogUserHandle::lists($filter['condition'], []);
  38. }
  39. /**
  40. * 要展示和导出的所有字段
  41. * @return array
  42. */
  43. public function getColumn(){
  44. if(!$this->columns){
  45. $this->columns = [
  46. 'save_before_content' => null,
  47. 'save_after_content' => null,
  48. 'opt_type' => [
  49. 'header' => 'Operation Type',//操作类型
  50. 'headerOther' => [
  51. 'width' => '200',
  52. ],
  53. 'valueOther' => function($row) {
  54. return [
  55. 'tag'=>['type'=>'success', 'size' => 'small']
  56. ];
  57. },
  58. ],
  59. 'opt_obj_name' => [
  60. 'header' => 'Operation Object Code',//操作对象编号
  61. 'headerOther' => [
  62. 'width' => '130',
  63. ],
  64. ],
  65. 'remark' => [
  66. 'header' => 'Remark', // 备注
  67. 'headerOther' => [
  68. 'width' => '120',
  69. 'show-overflow-tooltip'=>true,
  70. 'min-width'=>'200',
  71. ],
  72. ],
  73. 'user_name' => [
  74. 'header' => 'Operator',//操作人
  75. 'headerOther' => [
  76. 'width' => '130',
  77. ],
  78. ],
  79. 'created_at' => [
  80. 'header' => 'Operation Time',//操作时间
  81. 'value' => function($row) {
  82. return (new DateTime([
  83. 'value' => $row['created_at'],
  84. ]))->result();
  85. },
  86. 'headerOther' => ['width' => '180'],
  87. ],
  88. 'period_num' => 'Number of periods',//期数
  89. 'ip' => [
  90. 'header' => 'IP address',//IP地址
  91. 'headerOther' => [
  92. 'width' => '150',
  93. ],
  94. ],
  95. 'device' => [
  96. 'header' => 'client',//客户端
  97. 'headerOther' => [
  98. 'width' => '150',
  99. ],
  100. ],
  101. 'user_agent' => [
  102. 'header' => 'operating system',//操作系统
  103. 'headerOther' => [
  104. 'width' => '950',
  105. ],
  106. ],
  107. 'request_route' => [
  108. 'header' => 'Request path',//请求路径
  109. 'headerOther' => [
  110. 'width' => '250',
  111. ],
  112. ],
  113. ];
  114. }
  115. return $this->columns;
  116. }
  117. /**
  118. * 前台用于筛选的类型集合
  119. * @return mixed
  120. */
  121. public function getFilterTypes()
  122. {
  123. if(!$this->filterTypes){
  124. $selectData = [
  125. ['id'=>'开启关闭自动提现','name'=>'Enable / disable automatic withdrawal'],//开启关闭自动提现
  126. ['id'=>'开启关闭复销短信提醒','name'=>'Enable / disable re sales SMS reminder'],//开启关闭复销短信提醒
  127. ['id'=>'会员转账','name'=>'Member transfer'],//会员转账
  128. ['id'=>'会员提现申请','name'=>'Member withdrawal application'],//会员提现申请
  129. ['id'=>'会员修改资料','name'=>'Member modification information'],//会员修改资料
  130. ['id'=>'修改主点位','name'=>'Modify master point'],//修改主点位
  131. ];
  132. $this->filterTypes = [
  133. 'opt_type' => ['isUserTable'=>false, 'name'=>'Operation Type', 'other'=> 'select', 'selectData'=> $selectData],//操作类型
  134. 'opt_obj_name' => ['isUserTable'=>false, 'name'=>'Operation Object No'],//操作对象编号
  135. 'remark' => ['isUserTable'=>false, 'name'=>'Remark'], // 备注
  136. 'user_name' => ['isUserTable'=>false, 'name'=>'Operator'],//操作人
  137. 'created_at' => ['isUserTable'=>false, 'name'=>'Operation Time', 'other'=> 'date'],//操作时间
  138. 'period_num' => ['isUserTable'=>false, 'name'=>'Number of periods'],//操作时间
  139. 'ip' => ['isUserTable'=>false, 'name'=>'IP address'],//IP地址
  140. 'device' => ['isUserTable'=>false, 'name'=>'client'],//客户端
  141. 'user_agent' => ['isUserTable'=>false, 'name'=>'operating system'],//操作系统
  142. 'request_route' => ['isUserTable'=>false, 'name'=>'Request path'],//请求路径
  143. ];
  144. }
  145. return $this->filterTypes;
  146. }
  147. }