You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
1.5 KiB
77 lines
1.5 KiB
<?php
|
|
|
|
namespace App\Admin\Actions\Grid\v3;
|
|
|
|
use Dcat\Admin\Actions\Response;
|
|
use Dcat\Admin\Traits\HasPermissions;
|
|
use Dcat\Admin\Tree\AbstractTool;
|
|
use Illuminate\Contracts\Auth\Authenticatable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Http\Request;
|
|
|
|
class OrderReportToday extends AbstractTool
|
|
{
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
protected $title = '今日';
|
|
|
|
/**
|
|
* Handle the action request.
|
|
*
|
|
* @param Request $request
|
|
*
|
|
* @return Response
|
|
*/
|
|
public function handle(Request $request)
|
|
{
|
|
$today = date('Y-m-d');
|
|
$startTime = $today;
|
|
$endTime = $today;
|
|
return $this->response()
|
|
->success('查询中~')
|
|
->redirect('/order_report?start_time='.$startTime.'&end_time='.$endTime);
|
|
}
|
|
|
|
/**
|
|
* @return string|void
|
|
*/
|
|
// public function href()
|
|
// {
|
|
// return admin_url('/');
|
|
// }
|
|
|
|
/**
|
|
* @return string|array|void
|
|
*/
|
|
public function confirm()
|
|
{
|
|
// return ['Confirm?', 'contents'];
|
|
}
|
|
|
|
// protected function actionScript()
|
|
// {
|
|
|
|
// return <<<JS
|
|
// function (data, target, action) {
|
|
// console.log('发起请求之前', data, target, action);
|
|
|
|
// // return false; 在这里return false可以终止执行后面的操作
|
|
|
|
// // 更改传递到接口的主键值
|
|
// action.options.key = 123;
|
|
// }
|
|
// JS;
|
|
// }
|
|
|
|
/**
|
|
* @param Model|Authenticatable|HasPermissions|null $user
|
|
*
|
|
* @return bool
|
|
*/
|
|
protected function authorize($user): bool
|
|
{
|
|
return true;
|
|
}
|
|
}
|