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);