| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <?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\libs\dataList\column\DateTime;
- use common\libs\dataList\DataListInterface;
- use common\models\OpenBank;
- use common\models\User;
- use common\models\Withdraw;
- class WithdrawList extends \common\libs\dataList\DataList implements DataListInterface {
- /**
- * 列表名称
- * @return string
- */
- public function getListName() {
- return '提现申请列表';
- }
- /**
- * 列表筛选到的数据
- */
- public function dataHandle() {
- $this->listData = Withdraw::lists($this->condition, $this->params, [
- 'select' => 'W.*,U.USER_NAME,U.REAL_NAME AS USER_REAL_NAME,U.ID_CARD,U.MOBILE,U.OPEN_BANK,U.BANK_PROVINCE,U.BANK_CITY,U.BANK_COUNTY,U.BANK_ADDRESS,U.BANK_NO,ADM.ADMIN_NAME UPDATE_ADMIN_NAME,ADMA.ADMIN_NAME AUDIT_ADMIN_NAME',
- 'orderBy' => 'W.CREATED_AT DESC',
- 'from' => Withdraw::tableName() . ' AS W',
- 'join' => [
- ['LEFT JOIN', User::tableName() . ' AS U', 'W.USER_ID=U.ID'],
- ['LEFT JOIN', Admin::tableName() . ' AS ADM', 'ADM.ID=W.UPDATE_ADMIN'],
- ['LEFT JOIN', Admin::tableName() . ' AS ADMA', 'ADMA.ID=W.AUDIT_ADMIN'],
- ],
- 'page' => $this->page,
- 'pageSize' => $this->pageSize,
- ]);
- }
- /**
- * 要展示和导出的所有字段
- * @return array
- */
- public function getColumn() {
- $regionConfig = Cache::getRegionConfig();
- if (!$this->columns) {
- $this->columns = [
- 'ID' => null,
- 'SN' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceWithdrawSn'), // 提现流水号
- 'headerOther' => [
- 'width' => '250',
- ],
- 'valueOther' => function ($row) {
- return [
- 'tag' => ['type' => 'warning', 'size' => 'small', 'class' => 'no-border']
- ];
- },
- ],
- 'WITHDRAW_PERIOD_NUM' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceWithdrawPeriod'), // 提现期数
- 'headerOther' => ['width' => '150'],
- ],
- 'CREATED_AT' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceWithdrawAt'), // 提现时间
- 'value' => function ($row) {
- return (new DateTime([
- 'value' => $row['CREATED_AT'],
- ]))->result();
- },
- 'headerOther' => ['width' => '190'],
- ],
- 'AUDIT_STATUS' => null,
- 'AUDIT_STATUS_NAME' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceWithdrawState'), // 提现状态
- 'headerOther' => ['width' => '150'],
- 'value' => function ($row) {
- return Withdraw::getStatusName()[$row['AUDIT_STATUS']];
- // return Withdraw::STATUS_NAME[$row['AUDIT_STATUS']];
- },
- ],
- 'USER_NAME' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceBalanceAuditListUserName'), // 会员编号
- 'headerOther' => ['width' => '150'],
- ],
- 'USER_REAL_NAME' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceBalanceAuditListRealName'), // 会员姓名
- 'headerOther' => ['width' => '150'],
- ],
- 'AMOUNT' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceWithdrawAmount'), // 提现金额
- 'value' => function ($row) {
- return Tool::formatPrice($row['AMOUNT']);
- },
- 'headerOther' => [
- 'width' => '150',
- ],
- 'valueOther' => function ($row) {
- return [
- 'tag' => ['type' => 'danger', 'size' => 'small', 'class' => 'no-border']
- ];
- },
- ],
- 'FEES' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceWithdrawFees'), // 手续费
- 'headerOther' => ['width' => '150'],
- ],
- 'REAL_AMOUNT' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceWithdrawRealAmount'), // 实际到账金额
- 'headerOther' => ['width' => '150'],
- ],
- 'OPEN_BANK' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceWithdrawBank'), // 提现银行
- 'headerOther' => ['width' => '150'],
- 'value' => function ($row) {
- return $row['OPEN_BANK'] ? OpenBank::getCnName($row['OPEN_BANK']) : '';
- },
- ],
- 'BANK_NO' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceWithdrawBankNo'),//银行地区
- 'headerOther' => ['width' => '190'],
- 'value' => function ($row) {
- return $row['BANK_NO'].' /';
- },
- ],
- 'MOBILE' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceWithdrawMobile'), // 手机号
- 'headerOther' => ['width' => '150'],
- ],
- 'UPDATE_ADMIN_NAME' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceWithdrawUpdateAdminName'), // 操作管理员
- 'headerOther' => ['width' => '200'],
- ],
- 'REMARK' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceBalanceAuditListRemark'), // 备注
- 'headerOther' => [
- 'width' => '200',
- ],
- ],
- 'BACK_REMARK' => [
- 'header' => \Yii::t('ctx', 'modelListFinanceWithdrawBackRemark'), // 退回备注
- 'headerOther' => [
- 'width' => '200',
- ],
- ],
- ];
- }
- return $this->columns;
- }
- /**
- * 前台用于筛选的类型集合
- * @return mixed
- */
- public function getFilterTypes() {
- if (!$this->filterTypes) {
- $this->filterTypes = [
- 'SN' => ['isUserTable' => false, 'name' => \Yii::t('ctx', 'modelListFinanceWithdrawSn')], // 提现流水号
- 'USER_NAME' => ['isUserTable' => false, 'name' => \Yii::t('ctx', 'modelListFinanceBalanceAuditListUserName')], // 会员编号
- 'WITHDRAW_PERIOD_NUM' => ['isUserTable' => false, 'name' => \Yii::t('ctx', 'modelListFinanceWithdrawPeriod')], // 提现期数
- 'CREATED_AT' => ['isUserTable' => false, 'name' => \Yii::t('ctx', 'modelListFinanceWithdrawWithdrawalTime'), 'other' => 'date'], // 申请时间
- 'REAL_AMOUNT' => ['isUserTable' => false, 'name' => \Yii::t('ctx', 'modelListFinanceWithdrawRealAmount')] // 实际到账金额
- ];
- }
- return $this->filterTypes;
- }
- }
|