update:余额明细导出
This commit is contained in:
parent
a23ed93776
commit
19948a8c5e
@ -16,6 +16,7 @@ namespace app\adminapi\lists\finance;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\enum\user\AccountLogEnum;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\user\UserAccountLog;
|
||||
use app\common\model\user\UserRole;
|
||||
@ -27,9 +28,42 @@ use app\common\service\FileService;
|
||||
* Class AccountLogLists
|
||||
* @package app\adminapi\lists\finance
|
||||
*/
|
||||
class AccountLogLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
class AccountLogLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 导出字段
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2023/2/24 16:07
|
||||
*/
|
||||
public function setExcelFields(): array
|
||||
{
|
||||
return [
|
||||
'user_info.sn' => '用户编号',
|
||||
'company_info.company_name' => '归属公司',
|
||||
'user_info.nickname' => '用户昵称',
|
||||
'user_info.group_name' => '角色名称',
|
||||
'user_info.mobile' => '手机号码',
|
||||
'change_amount' => '变动金额',
|
||||
'left_amount' => '剩余金额',
|
||||
'change_type_desc' => '变动类型',
|
||||
'source_sn' => '来源单号',
|
||||
'create_time' => '记录时间',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 导出表名
|
||||
* @return string
|
||||
* @author 段誉
|
||||
* @date 2023/2/24 16:07
|
||||
*/
|
||||
public function setFileName(): string
|
||||
{
|
||||
return '余额明细';
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 搜索条件
|
||||
* @return array
|
||||
|
@ -60,14 +60,14 @@ class WithdrawLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
if ($withdrawedCount == 0) {
|
||||
$company = Company::where(['admin_id'=>$item['admin_id']])->find();
|
||||
$firstUserLog = UserAccountLog::where(['company_id'=>$company['id']])->order('id', 'asc')->find();
|
||||
$item['s_date'] = strtotime($firstUserLog['create_time']);
|
||||
$item['s_date'] = $firstUserLog['create_time'];
|
||||
} else {
|
||||
// 如果用户已成功申请过提现,则以上次提现的截止日期为开始时间
|
||||
$withdrawedCount = Withdraw::where(['user_id'=>$item['user_id'], 'status'=>3])->order('id', 'desc')->find();
|
||||
$item['s_date'] = $withdrawedCount['transfer_end_cycel'];
|
||||
}
|
||||
// 结束时间
|
||||
$item['e_date'] = $item['transfer_end_cycel'];
|
||||
$item['e_date'] = date('Y-m-d H:i:s', $item['transfer_end_cycel']);
|
||||
}
|
||||
unset($item);
|
||||
return $lists;
|
||||
|
Loading…
x
Reference in New Issue
Block a user