From af91fa18aba6c4af28b16f6740e655b5e91f134b Mon Sep 17 00:00:00 2001 From: xuanchen <122383162@qq.com> Date: Mon, 7 Feb 2022 15:36:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96=E5=B9=B3?= =?UTF-8?q?=E5=AE=89=E8=AE=A2=E5=8D=95id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Actions/Coupon/RefreshPAOrder.php | 14 +++++++++++--- app/Admin/Controllers/Coupon/IndexController.php | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/Admin/Actions/Coupon/RefreshPAOrder.php b/app/Admin/Actions/Coupon/RefreshPAOrder.php index 44e5f1b..299b64f 100644 --- a/app/Admin/Actions/Coupon/RefreshPAOrder.php +++ b/app/Admin/Actions/Coupon/RefreshPAOrder.php @@ -4,6 +4,7 @@ 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; @@ -13,16 +14,23 @@ class RefreshPAOrder extends Action protected $selector = '.refresh-order'; - public function handle(Request $request) + public function handle(Request $request): \Encore\Admin\Actions\Response { - $table = 'api_log_'.date('Ym'); + $month = $request->month; + $month = Carbon::parse($month)->format('Ym'); + $table = 'api_log_'.$month; CheckCouponLog::dispatch($table); - CheckCouponByLog::dispatch($table); + CheckCouponByLog::dispatch($table)->delay(now()->addMinutes(10));; return $this->response()->success('正在获取数据,请等待片刻后刷新页面查看!')->refresh(); } + public function form() + { + $this->date('month', '月份')->format('YYYY-MM'); + } + public function html() { return <<disableActions(); $grid->tools(function (Grid\Tools $tools) { - $tools->append(new refreshPAOrder());//食物 + $tools->append(new refreshPAOrder());//刷新平安订单id }); $grid->model()