| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- <?php
- namespace backendApi\modules\v1\models\lists\bonus;
- use backendApi\modules\v1\models\Admin;
- use common\helpers\bonus\CalcCache;
- use common\helpers\Cache;
- use common\helpers\Tool;
- use common\helpers\user\Info;
- use common\libs\dataList\column\Price;
- use common\libs\dataList\column\YesNo;
- use common\libs\dataList\DataListInterface;
- use common\models\CalcBonus;
- use common\models\CalcBonusBD;
- use common\models\PerfOrder;
- use common\models\PerfPeriod;
- use common\models\Period;
- use common\models\Region;
- use common\models\UserBind;
- use common\models\UserBonus;
- use common\models\UserInfo;
- use common\libs\dataList\column\DateTime;
- use common\models\UserNetwork;
- use common\models\UserSystem;
- use common\models\Withdraw;
- use Yii;
- class TraceUpBdList extends \common\libs\dataList\DataList implements DataListInterface
- {
- /**
- * 列表名称
- * @return string
- */
- public function getListName(){
- return '服务奖向上追溯';
- }
- /**
- * 列表筛选到的数据
- * @throws \yii\base\Exception
- */
- public function dataHandle()
- {
- $yearMonth = $this->others['yearMonth'];
- $data = CalcBonusBD::lists($this->condition, $this->params, [
- 'select' => 'CBB.*',
- 'from' => CalcBonusBD::tableName() . ' AS CBB',
- 'join' => [
- ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CBB.FROM_USER_ID=UI.USER_ID'],
- ],
- 'orderBy' => 'CBB.CREATED_AT ASC, CBB.ID ASC',
- 'yearMonth' => $yearMonth,
- 'page' => $this->page,
- 'pageSize' => $this->pageSize,
- ]);
- if ($data['list']) {
- foreach ($data['list'] as $key => $value) {
- $userInfo = Info::baseInfoZh($value['USER_ID']);
- $data['list'][$key] = array_merge($userInfo, $value);
- $data['list'][$key]['LAST_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$value['LAST_DEC_LV']]['LEVEL_NAME'] ?? '';
- $data['list'][$key]['LAST_EMP_LV_NAME'] = Cache::getEmpLevelConfig()[$value['LAST_EMP_LV']]['LEVEL_NAME'] ?? '';
- $data['list'][$key]['LAST_STATUS_NAME'] = Tool::paramConvert(Yii::$app->params['userStatus'])[$value['LAST_STATUS']]['label'] ?? '';
- }
- }
- $this->listData = $data;
- }
- /**
- * 要展示和导出的所有字段
- * @return array
- */
- public function getColumn(){
- if(!$this->columns){
- $this->columns = [
- 'PERIOD_NUM' => [
- 'header' => '结算期数',
- ],
- 'USER_NAME' => [
- 'header' => '报单中心编号',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'valueOther' => [
- 'tag'=>['type'=>'info', 'size' => 'small', 'class'=>'no-border']
- ],
- ],
- 'REAL_NAME' => [
- 'header' => '报单中心姓名',
- 'headerOther' => [
- 'width' => '120',
- ],
- 'valueOther' => [
- 'tag'=>['type'=>'success', 'size' => 'small', 'class'=>'no-border']
- ],
- ],
- 'LAST_STATUS_NAME' => [
- 'header' => '结算时状态',
- 'headerOther' => [
- 'width' => '110',
- ],
- ],
- 'LAST_DEC_LV_NAME' => [
- 'header' => '结算时会员级别',
- 'headerOther' => [
- 'width' => '120',
- ],
- ],
- 'LAST_EMP_LV_NAME' => [
- 'header' => '结算时会员聘级',
- 'headerOther' => [
- 'width' => '140',
- ],
- ],
- 'AMOUNT' => [
- 'header' => '提供服务奖金额',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['AMOUNT'],
- ]))->result();
- },
- 'valueOther' => function($row){
- return [
- 'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
- ];
- },
- ],
- 'ORI_BONUS' => [
- 'header' => '原金额',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['ORI_BONUS'],
- ]))->result();
- },
- 'valueOther' => function($row){
- return [
- 'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
- ];
- },
- ],
- 'RECONSUME_POINTS' => [
- 'header' => '复消积分',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['RECONSUME_POINTS'],
- ]))->result();
- },
- 'valueOther' => function($row){
- return [
- 'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
- ];
- },
- ],
- 'MANAGE_TAX' => [
- 'header' => '管理费',
- 'headerOther' => [
- 'width' => '150',
- ],
- 'value' => function($row) {
- return (new Price([
- 'value' => $row['MANAGE_TAX'],
- ]))->result();
- },
- 'valueOther' => function($row){
- return [
- 'tag'=>['type'=>'danger', 'size' => 'small', 'class'=>'no-border'],
- ];
- },
- ],
- // 'DEEP' => [
- // 'header' => '紧缩代数',
- // 'headerOther' => [
- // 'width' => '80',
- // ],
- // ],
- 'CALC_MONTH' => [
- 'header' => '结算月',
- 'headerOther' => [
- 'width' => '110',
- ],
- ],
- ];
- }
- return $this->columns;
- }
- /**
- * 前台用于筛选的类型集合
- * @return mixed
- */
- public function getFilterTypes()
- {
- if(!$this->filterTypes){
- $this->filterTypes = [];
- }
- return $this->filterTypes;
- }
- }
|