手动刷新平安订单
This commit is contained in:
32
app/Admin/Actions/Coupon/RefreshPAOrder.php
Normal file
32
app/Admin/Actions/Coupon/RefreshPAOrder.php
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Admin\Actions\Coupon;
|
||||||
|
|
||||||
|
use App\Jobs\CheckCouponByLog;
|
||||||
|
use App\Jobs\CheckCouponLog;
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
$table = 'api_log_'.date('Ym');
|
||||||
|
|
||||||
|
CheckCouponLog::dispatch($table);
|
||||||
|
CheckCouponByLog::dispatch($table);
|
||||||
|
|
||||||
|
return $this->response()->success('正在获取数据,请等待片刻后刷新页面查看!')->refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function html()
|
||||||
|
{
|
||||||
|
return <<<HTML
|
||||||
|
<a class="btn btn-sm btn-default refresh-order "><i class="fa fa-refresh"></i>刷新平安订单id</a>
|
||||||
|
HTML;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Admin\Controllers\Coupon;
|
namespace App\Admin\Controllers\Coupon;
|
||||||
|
|
||||||
|
use App\Admin\Actions\Coupon\RefreshPAOrder;
|
||||||
use App\Models\ActivityRule;
|
use App\Models\ActivityRule;
|
||||||
use App\Models\Coupon;
|
use App\Models\Coupon;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
@@ -27,6 +28,10 @@ class IndexController extends AdminController
|
|||||||
$grid->disableBatchActions();
|
$grid->disableBatchActions();
|
||||||
$grid->disableActions();
|
$grid->disableActions();
|
||||||
|
|
||||||
|
$grid->tools(function (Grid\Tools $tools) {
|
||||||
|
$tools->append(new refreshPAOrder());//食物
|
||||||
|
});
|
||||||
|
|
||||||
$grid->model()
|
$grid->model()
|
||||||
->with(['outlet.province', 'outlet.city', 'outlet.district', 'user', 'user.info'])
|
->with(['outlet.province', 'outlet.city', 'outlet.district', 'user', 'user.info'])
|
||||||
->whereIn('status', [2, 3])
|
->whereIn('status', [2, 3])
|
||||||
|
|||||||
Reference in New Issue
Block a user