| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- <?php
- namespace backendApi\modules\v1\models\lists\finance;
- use backendApi\modules\v1\models\Admin;
- use common\helpers\Audit;
- use common\helpers\Cache;
- use common\helpers\Tool;
- use common\helpers\user\Info;
- use common\helpers\user\Reconsume;
- use common\libs\dataList\column\DateTime;
- use common\libs\dataList\column\YesNo;
- use common\libs\dataList\DataListInterface;
- use common\models\BalanceAudit;
- use common\models\DealType;
- use common\models\forms\ReconsumeForm;
- use common\models\PerfAudit;
- use common\models\ReconsumeAudit;
- use common\models\ReconsumePool;
- use common\models\DecRole;
- use common\models\Transfer;
- use common\models\UserInfo;
- use common\models\UserSystem;
- use common\models\YearHighestEmpLv;
- use Yii;
- class TransferList extends \common\libs\dataList\DataList implements DataListInterface {
- /**
- * 列表名称
- * @return string
- */
- public function getListName() {
- return '转账记录列表';
- }
- /**
- * 列表筛选到的数据
- * @throws \yii\base\Exception
- */
- public function dataHandle() {
- $this->listData = Transfer::lists($this->condition, $this->params, [
- 'orderBy' => 'CREATED_AT DESC, ID DESC',
- 'from' => Transfer::tableName(),
- 'page' => $this->page,
- 'pageSize' => $this->pageSize,
- ]);
- foreach ($this->listData['list'] as $key => $value) {
- $this->listData['list'][$key]['LAST_OUT_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$value['LAST_OUT_DEC_LV']]['LEVEL_NAME'] ?? '';
- // $this->listData['list'][$key]['LAST_OUT_DEC_ROLE_NAME'] = DecRole::getRoleNameId($value['LAST_OUT_DEC_ROLE_ID']);
- // $this->listData['list'][$key]['LAST_OUT_SYSTEM_NAME'] = UserSystem::getSystem($value['LAST_OUT_SYSTEM_ID'])['SYSTEM_NAME'] ?? '';
- $this->listData['list'][$key]['LAST_IN_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$value['LAST_IN_DEC_LV']]['LEVEL_NAME'] ?? '';
- // $this->listData['list'][$key]['LAST_IN_SYSTEM_NAME'] = UserSystem::getSystem($value['LAST_IN_SYSTEM_ID'])['SYSTEM_NAME'] ?? '';
- }
- }
- /**
- * 要展示和导出的所有字段
- * @return array
- */
- public function getColumn() {
- if (!$this->columns) {
- $this->columns = [
- 'ID' => null, // 这种传输方式主要是用于索引,因为过滤后的字段可能没有这种ID,但是一些功能的操作还需要用这种ID去关联,例如前台会员列表中的勾选批量状态管理,这里需要的就是USER_ID
- 'TRANSFER_SN' => [
- 'header' => '转账记录流水号',
- 'headerOther' => [
- 'width' => '250',
- ],
- 'valueOther' => function ($row) {
- return [
- 'tag' => ['type' => 'warning', 'size' => 'small', 'class' => 'no-border']
- ];
- },
- ],
- 'LAST_OUT_USER_NAME' => [
- 'header' => '转出会员编号',
- 'headerOther' => ['width' => '150'],
- ],
- 'LAST_OUT_REAL_NAME' => [
- 'header' => '转出会员姓名',
- 'headerOther' => [
- 'width' => '120',
- ],
- ],
- 'LAST_OUT_DEC_LV_NAME' => [
- 'header' => '转出主体会员级别',
- 'headerOther' => [
- 'width' => '150',
- ],
- ],
- // 'LAST_OUT_DEC_ROLE_NAME' => [
- // 'header' => '转出主体报单中心级别',
- // 'headerOther' => [
- // 'width' => '170',
- // ],
- // ],
- 'OUT_WALLET' => [
- 'header' => '转出账户',
- 'value' => function ($row) {
- return Transfer::WALLET_NAME[$row['OUT_WALLET']];
- },
- 'headerOther' => [
- 'width' => '150',
- ],
- ],
- // 'LAST_OUT_SYSTEM_NAME' => [
- // 'header' => '转出会员体系',
- // 'headerOther' => [
- // 'width' => '150',
- // ],
- // ],
- 'LAST_IN_USER_NAME' => [
- 'header' => '转入会员编号',
- 'headerOther' => ['width' => '150'],
- ],
- 'LAST_IN_REAL_NAME' => [
- 'header' => '转入会员姓名',
- 'headerOther' => [
- 'width' => '120',
- ],
- ],
- 'LAST_IN_DEC_LV_NAME' => [
- 'header' => '转入主体级别',
- 'headerOther' => [
- 'width' => '150',
- ],
- ],
- 'IN_WALLET' => [
- 'header' => '转入账户',
- 'value' => function ($row) {
- return Transfer::WALLET_NAME[$row['IN_WALLET']];
- },
- 'headerOther' => [
- 'width' => '150',
- ],
- ],
- // 'LAST_IN_SYSTEM_NAME' => [
- // 'header' => '转入会员体系',
- // 'headerOther' => [
- // 'width' => '150',
- // ],
- // ],
- 'ORI_AMOUNT' => [
- 'header' => '转账金额',
- 'value' => function ($row) {
- return Tool::formatPrice($row['ORI_AMOUNT']);
- },
- 'headerOther' => [
- 'width' => '150',
- ],
- ],
- 'FEE' => [
- 'header' => '手续费',
- 'value' => function ($row) {
- return Tool::formatPrice($row['FEE']);
- },
- 'headerOther' => [
- 'width' => '150',
- ],
- ],
- 'AMOUNT' => [
- 'header' => '实际转入金额',
- 'value' => function ($row) {
- return Tool::formatPrice($row['AMOUNT']);
- },
- 'headerOther' => [
- 'width' => '150',
- ],
- 'valueOther' => function ($row) {
- return [
- 'tag' => ['type' => 'danger', 'size' => 'small', 'class' => 'no-border']
- ];
- },
- ],
- 'CREATED_AT' => [
- 'header' => '转账时间',
- 'value' => function ($row) {
- return (new DateTime([
- 'value' => $row['CREATED_AT'],
- ]))->result();
- },
- 'headerOther' => ['width' => '190'],
- ],
- 'PERIOD_NUM' => [
- 'header' => '转账期数',
- 'headerOther' => [
- 'width' => '150',
- ],
- ],
- 'REMARK' => [
- 'header' => '备注',
- 'headerOther' => [
- 'width' => '200',
- ],
- ],
- ];
- }
- return $this->columns;
- }
- /**
- * 前台用于筛选的类型集合
- * @return mixed
- */
- public function getFilterTypes() {
- if (!$this->filterTypes) {
- $this->filterTypes = [
- 'TRANSFER_SN' => ['isUserTable' => false, 'name' => '转账记录流水号'],
- 'LAST_OUT_USER_NAME' => ['isUserTable' => false, 'name' => '转出会员编号'],
- 'LAST_OUT_REAL_NAME' => ['isUserTable' => false, 'name' => '转出会员姓名'],
- 'LAST_OUT_DEC_LV_NAME' => ['isUserTable' => false, 'name' => '转出主体会员级别', 'other' => 'decLevel'],
- // 'LAST_OUT_DEC_ROLE_NAME' => ['isUserTable' => false, 'name' => '转出主体报单中心级别', 'other' => 'decRole'],
- 'OUT_WALLET' => ['isUserTable' => false, 'name' => '转出账户', 'other' => 'select', 'selectData' => [['id' => 'bonus', 'name' => '会员账户'], ['id' => 'cash', 'name' => '现金钱包']]],
- // 'LAST_OUT_SYSTEM_NAME' => ['isUserTable' => false, 'name' => '转出会员体系', 'other' => 'systems'],
- 'LAST_IN_USER_NAME' => ['isUserTable' => false, 'name' => '转入会员编号'],
- 'LAST_IN_REAL_NAME' => ['isUserTable' => false, 'name' => '转入会员姓名'],
- 'LAST_IN_DEC_LV_NAME' => ['isUserTable' => false, 'name' => '转入主体级别', 'other' => 'decLevel'],
- 'IN_WALLET' => ['isUserTable' => false, 'name' => '转入账户', 'other' => 'select', 'selectData' => [['id' => 'bonus', 'name' => '会员账户'], ['id' => 'cash', 'name' => '现金钱包']]],
- // 'LAST_IN_SYSTEM_NAME' => ['isUserTable' => false, 'name' => '转入会员体系', 'other' => 'systems'],
- 'ORI_AMOUNT' => ['isUserTable' => false, 'name' => '转账金额'],
- 'FEE' => ['isUserTable' => false, 'name' => '手续费'],
- 'AMOUNT' => ['isUserTable' => false, 'name' => '实际转入金额'],
- 'CREATED_AT' => ['isUserTable' => false, 'name' => '转账时间', 'other' => 'date'],
- 'PERIOD_NUM' => ['isUserTable' => false, 'name' => '转账期数'],
- 'REMARK' => ['isUserTable' => false, 'name' => '备注'],
- ];
- }
- return $this->filterTypes;
- }
- }
|