From 5192cc2576bb108cd6d0661e393cab8a6ca94379 Mon Sep 17 00:00:00 2001 From: xuanchen <122383162@qq.com> Date: Mon, 7 Feb 2022 15:48:30 +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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Admin/Actions/Coupon/RefreshPAOrder.php b/app/Admin/Actions/Coupon/RefreshPAOrder.php index 99e0a2f..72036b2 100644 --- a/app/Admin/Actions/Coupon/RefreshPAOrder.php +++ b/app/Admin/Actions/Coupon/RefreshPAOrder.php @@ -6,7 +6,9 @@ use App\Jobs\CheckCouponByLog; use App\Jobs\CheckCouponLog; use Carbon\Carbon; use Encore\Admin\Actions\Action; +use Illuminate\Database\Schema\Blueprint; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Schema; class RefreshPAOrder extends Action { @@ -19,6 +21,12 @@ class RefreshPAOrder extends Action $month = $request->month; $month = Carbon::parse($month)->format('Ym'); $table = 'api_log_'.$month; + + if (! Schema::hasColumn($table, 'coupon_no')) { + Schema::table($table, function (Blueprint $table) { + $table->string('coupon_no')->after('out_source')->nullable(); + }); + } CheckCouponLog::dispatch($table); CheckCouponByLog::dispatch($table, 10);