提交代码
This commit is contained in:
39
app/Admin/Exporters/CashOutExport.php
Normal file
39
app/Admin/Exporters/CashOutExport.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Exporters;
|
||||
|
||||
use Encore\Admin\Grid\Exporters\ExcelExporter;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
|
||||
class CashOutExport extends ExcelExporter implements WithMapping
|
||||
{
|
||||
protected $fileName = '提现用户.xlsx';
|
||||
|
||||
protected $columns = [
|
||||
'id' => '序号',
|
||||
'user_id' => '用户ID',
|
||||
'user.username' => '用户账号',
|
||||
'user.info.nickname' => '用户昵称',
|
||||
'cash_account_no' => '支付宝账户',
|
||||
'variable' => '提现金额',
|
||||
'state' => '提现状态',
|
||||
'created_at' => '提现时间',
|
||||
];
|
||||
|
||||
public function map($info): array
|
||||
{
|
||||
$data = [
|
||||
'id' => $info->id,
|
||||
'user_id' => $info->user_id,
|
||||
'user.username' => ' ' . $info->user->username,
|
||||
'user.info.nickname' => ' ' . $info->user->info->nickname,
|
||||
'cash_account_no' => ' ' . $info->cash_account_no,
|
||||
'variable' => ' ' . $info->variable,
|
||||
'state' => $info->state_text,
|
||||
'created_at' => $info->created_at,
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user