UserPerfList.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <?php
  2. namespace backendApi\modules\v1\models\lists\bonus;
  3. use common\helpers\Cache;
  4. use common\helpers\user\Info;
  5. use common\models\PerfMonth;
  6. use common\models\User as modelUser;
  7. use common\libs\dataList\column\Price;
  8. use common\libs\dataList\DataListInterface;
  9. use common\libs\dataList\column\DateTime;
  10. use common\models\UserInfo;
  11. use common\models\UserPerf;
  12. use Yii;
  13. class UserPerfList extends \common\libs\dataList\DataList implements DataListInterface
  14. {
  15. /**
  16. * 列表名称
  17. * @return string
  18. */
  19. public function getListName(){
  20. return '用户业绩列表';
  21. }
  22. /**
  23. * 列表筛选到的数据
  24. * @throws \yii\base\Exception
  25. */
  26. public function dataHandle()
  27. {
  28. $data = UserPerf::lists($this->condition, $this->params, [
  29. 'select'=>'UP.*, U.USER_NAME, U.REAL_NAME',
  30. 'from' => UserPerf::tableName().' AS UP',
  31. 'join' => [
  32. ['LEFT JOIN', modelUser::tableName() . ' AS U', 'UP.USER_ID=U.ID'],
  33. ],
  34. 'orderBy' => 'UP.ID DESC',
  35. 'page' => $this->page,
  36. 'pageSize' => $this->pageSize,
  37. ]);
  38. $this->listData = $data;
  39. }
  40. /**
  41. * 要展示和导出的所有字段
  42. * @return array
  43. */
  44. public function getColumn(){
  45. if(!$this->columns){
  46. $this->columns = [
  47. 'USER_NAME' => [
  48. 'header' => 'Member code',//会员编号
  49. 'headerOther' => [
  50. 'width' => '200',
  51. ],
  52. ],
  53. 'REAL_NAME' => [
  54. 'header' => 'Member name',//会员姓名
  55. 'headerOther' => [
  56. 'width' => '200',
  57. ],
  58. ],
  59. 'PV_PCS' => [
  60. 'header' => 'Personal performance',//个人业绩
  61. 'headerOther' => [
  62. 'width' => '180',
  63. ],
  64. 'value' => function($row) {
  65. return (new Price([
  66. 'value' => $row['PV_PCS_ZC'] + $row['PV_PCS_FX'],
  67. ]))->result();
  68. },
  69. ],
  70. 'SURPLUS_1L' => [
  71. 'header' => 'Left market residual performance',//一市场剩余业绩
  72. 'headerOther' => [
  73. 'width' => '240',
  74. ],
  75. 'value' => function($row) {
  76. return (new Price([
  77. 'value' => $row['SURPLUS_1L'],
  78. ]))->result();
  79. },
  80. ],
  81. 'SURPLUS_2L' => [
  82. 'header' => 'Right market residual performance',//二市场剩余业绩
  83. 'headerOther' => [
  84. 'width' => '240',
  85. ],
  86. 'value' => function($row) {
  87. return (new Price([
  88. 'value' => $row['SURPLUS_2L'],
  89. ]))->result();
  90. },
  91. ],
  92. // 'SURPLUS_3L' => [
  93. // 'header' => '三市场剩余业绩',
  94. // 'headerOther' => [
  95. // 'width' => '150',
  96. // ],
  97. // 'value' => function($row) {
  98. // return (new Price([
  99. // 'value' => $row['SURPLUS_3L'],
  100. // ]))->result();
  101. // },
  102. // ],
  103. // 'SURPLUS_1L_ZC' => [
  104. // 'header' => 'I. remaining performance of market declaration',//一市场报单剩余业绩
  105. // 'headerOther' => [
  106. // 'width' => '150',
  107. // ],
  108. // 'value' => function($row) {
  109. // return (new Price([
  110. // 'value' => $row['SURPLUS_1L_ZC'],
  111. // ]))->result();
  112. // },
  113. // ],
  114. // 'SURPLUS_2L_ZC' => [
  115. // 'header' => 'II. remaining performance of market declaration',//二市场报单剩余业绩
  116. // 'headerOther' => [
  117. // 'width' => '150',
  118. // ],
  119. // 'value' => function($row) {
  120. // return (new Price([
  121. // 'value' => $row['SURPLUS_2L_ZC'],
  122. // ]))->result();
  123. // },
  124. // ],
  125. // 'SURPLUS_3L_ZC' => [
  126. // 'header' => '三市场报单剩余业绩',
  127. // 'headerOther' => [
  128. // 'width' => '150',
  129. // ],
  130. // 'value' => function($row) {
  131. // return (new Price([
  132. // 'value' => $row['SURPLUS_3L_ZC'],
  133. // ]))->result();
  134. // },
  135. // ],
  136. // 'VIP_SURPLUS_1L_ZC' => [
  137. // 'header' => 'I. remaining performance of VIP declaration in the market',//一市场VIP报单剩余业绩
  138. // 'headerOther' => [
  139. // 'width' => '150',
  140. // ],
  141. // 'value' => function($row) {
  142. // return (new Price([
  143. // 'value' => $row['VIP_SURPLUS_1L_ZC'],
  144. // ]))->result();
  145. // },
  146. // ],
  147. // 'VIP_SURPLUS_2L_ZC' => [
  148. // 'header' => 'II. remaining performance of VIP declaration in the market',//二市场VIP报单剩余业绩
  149. // 'headerOther' => [
  150. // 'width' => '150',
  151. // ],
  152. // 'value' => function($row) {
  153. // return (new Price([
  154. // 'value' => $row['VIP_SURPLUS_2L_ZC'],
  155. // ]))->result();
  156. // },
  157. // ],
  158. // 'VIP_SURPLUS_3L_ZC' => [
  159. // 'header' => '三市场VIP报单剩余业绩',
  160. // 'headerOther' => [
  161. // 'width' => '150',
  162. // ],
  163. // 'value' => function($row) {
  164. // return (new Price([
  165. // 'value' => $row['VIP_SURPLUS_3L_ZC'],
  166. // ]))->result();
  167. // },
  168. // ],
  169. 'PV_PSS_TOTAL' => [
  170. 'header' => 'Cumulative team performance',//累计团队业绩
  171. 'headerOther' => [
  172. 'width' => '250',
  173. ],
  174. 'value' => function($row) {
  175. return (new Price([
  176. 'value' => $row['PV_PSS_TOTAL'],
  177. ]))->result();
  178. },
  179. ],
  180. ];
  181. }
  182. return $this->columns;
  183. }
  184. /**
  185. * 前台用于筛选的类型集合
  186. * @return mixed
  187. */
  188. public function getFilterTypes()
  189. {
  190. if(!$this->filterTypes){
  191. $this->filterTypes = [
  192. 'USER_NAME'=> ['isUserTable'=> false, 'name'=> 'Member code'],//会员编号
  193. ];
  194. }
  195. return $this->filterTypes;
  196. }
  197. }