41 lines
1019 B
PHP
41 lines
1019 B
PHP
<?php
|
|
|
|
namespace App\Admin\Actions\Coupon;
|
|
|
|
use App\Jobs\CheckCouponByLog;
|
|
use App\Jobs\CheckCouponLog;
|
|
use Carbon\Carbon;
|
|
use Encore\Admin\Actions\Action;
|
|
use Illuminate\Http\Request;
|
|
|
|
class RefreshPAOrder extends Action
|
|
{
|
|
public $name = '刷新平安订单id';
|
|
|
|
protected $selector = '.refresh-order';
|
|
|
|
public function handle(Request $request): \Encore\Admin\Actions\Response
|
|
{
|
|
$month = $request->month;
|
|
$month = Carbon::parse($month)->format('Ym');
|
|
$table = 'api_log_'.$month;
|
|
|
|
CheckCouponLog::dispatch($table);
|
|
CheckCouponByLog::dispatch($table, 10);
|
|
|
|
return $this->response()->success('正在获取数据,请等待片刻后刷新页面查看!')->refresh();
|
|
}
|
|
|
|
public function form()
|
|
{
|
|
$this->date('month', '月份')->format('YYYY-MM');
|
|
}
|
|
|
|
public function html()
|
|
{
|
|
return <<<HTML
|
|
<a class="btn btn-sm btn-default refresh-order "><i class="fa fa-refresh"></i> 刷新平安订单id</a>
|
|
HTML;
|
|
}
|
|
}
|