6
0
Fork 0
jiqu-library-server/app/Admin/Actions/Grid/Exports/DealerWalletWithdraw.php

45 lines
1.1 KiB
PHP

<?php
namespace App\Admin\Actions\Grid\Exports;
use Dcat\Admin\Actions\Response;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Traits\HasPermissions;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
class DealerWalletWithdraw extends RowAction
{
public function title()
{
if ($this->title) {
return $this->title;
}
return '<i class="feather grid-action-icon icon-download"></i> 导出打款单&nbsp;&nbsp;';
}
/**
* @param Model|Authenticatable|HasPermissions|null $user
*
* @return bool
*/
protected function authorize($user): bool
{
return $user->can('dcat.admin.dealer_wallet_to_bank_logs.export');
}
/**
* Handle the action request.
*
* @param Request $request
*
* @return Response
*/
public function handle(Request $request)
{
$last_path_arr = parse_url(session('admin.prev.url'));
return $this->response()->download(admin_route('dealer_wallet_to_bank_logs.export').'?'.($last_path_arr['query']??''));
}
}