优化获取平安订单id
This commit is contained in:
@@ -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 <<<HTML
|
||||
|
||||
@@ -29,7 +29,7 @@ class IndexController extends AdminController
|
||||
$grid->disableActions();
|
||||
|
||||
$grid->tools(function (Grid\Tools $tools) {
|
||||
$tools->append(new refreshPAOrder());//食物
|
||||
$tools->append(new refreshPAOrder());//刷新平安订单id
|
||||
});
|
||||
|
||||
$grid->model()
|
||||
|
||||
Reference in New Issue
Block a user