| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <?php
- namespace backendApi\modules\v1\models\lists\bonus;
- use common\helpers\Cache;
- use common\helpers\user\Info;
- use common\models\PerfMonth;
- use common\models\User as modelUser;
- use common\libs\dataList\column\Price;
- use common\libs\dataList\DataListInterface;
- use common\libs\dataList\column\DateTime;
- use common\models\UserInfo;
- use common\models\UserPerf;
- use Yii;
- class UserPerfList extends \common\libs\dataList\DataList implements DataListInterface
- {
- /**
- * 列表名称
- * @return string
- */
- public function getListName(){
- return '用户业绩列表';
- }
- /**
- * 列表筛选到的数据
- * @throws \yii\base\Exception
- */
- public function dataHandle()
- {
- $data = UserPerf::lists($this->condition, $this->params, [
- 'select'=>'UP.*, U.USER_NAME, U.REAL_NAME',
- 'from' => UserPerf::tableName().' AS UP',
- 'join' => [
- ['LEFT JOIN', modelUser::tableName() . ' AS U', 'UP.USER_ID=U.ID'],
- ],
- 'orderBy' => 'UP.ID DESC',
- 'page' => $this->page,
- 'pageSize' => $this->pageSize,
- ]);
- $this->listData = $data;
- }
- /**
- * 要展示和导出的所有字段
- * @return array
- */
- public function getColumn(){
- if(!$this->columns){
- $this->columns = [
- 'USER_NAME' => [
- 'header' => '会员编号',
- 'headerOther' => [
- 'width' => '110',
- ],
- ],
- 'REAL_NAME' => [
- 'header' => '会员姓名',
- 'headerOther' => [
- 'width' => '150',
- ],
- ],
- 'PV_PCS' => [
- 'header' => '个人业绩',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['PV_PCS_ZC'] + $row['PV_PCS_FX'],
- ]))->result();
- },
- ],
- 'SURPLUS_1L' => [
- 'header' => '一市场剩余业绩',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['SURPLUS_1L'],
- ]))->result();
- },
- ],
- 'SURPLUS_2L' => [
- 'header' => '二市场剩余业绩',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['SURPLUS_2L'],
- ]))->result();
- },
- ],
- 'SURPLUS_3L' => [
- 'header' => '三市场剩余业绩',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['SURPLUS_3L'],
- ]))->result();
- },
- ],
- 'SURPLUS_1L_ZC' => [
- 'header' => '一市场报单剩余业绩',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['SURPLUS_1L_ZC'],
- ]))->result();
- },
- ],
- 'SURPLUS_2L_ZC' => [
- 'header' => '二市场报单剩余业绩',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['SURPLUS_2L_ZC'],
- ]))->result();
- },
- ],
- 'SURPLUS_3L_ZC' => [
- 'header' => '三市场报单剩余业绩',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['SURPLUS_3L_ZC'],
- ]))->result();
- },
- ],
- 'VIP_SURPLUS_1L_ZC' => [
- 'header' => '一市场VIP报单剩余业绩',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['VIP_SURPLUS_1L_ZC'],
- ]))->result();
- },
- ],
- 'VIP_SURPLUS_2L_ZC' => [
- 'header' => '二市场VIP报单剩余业绩',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['VIP_SURPLUS_2L_ZC'],
- ]))->result();
- },
- ],
- 'VIP_SURPLUS_3L_ZC' => [
- 'header' => '三市场VIP报单剩余业绩',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['VIP_SURPLUS_3L_ZC'],
- ]))->result();
- },
- ],
- 'PV_PSS_TOTAL' => [
- 'header' => '累计团队业绩',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['PV_PSS_TOTAL'],
- ]))->result();
- },
- ],
- ];
- }
- return $this->columns;
- }
- /**
- * 前台用于筛选的类型集合
- * @return mixed
- */
- public function getFilterTypes()
- {
- if(!$this->filterTypes){
- $this->filterTypes = [
- 'USER_NAME'=> ['isUserTable'=> false, 'name'=> '会员编号'],
- ];
- }
- return $this->filterTypes;
- }
- }
|