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.
54 lines
1.1 KiB
54 lines
1.1 KiB
<?php
|
|
|
|
|
|
namespace App\Admin\Actions\Tools;
|
|
|
|
|
|
use Dcat\Admin\Admin;
|
|
use Dcat\Admin\Grid\Tools\AbstractTool;
|
|
|
|
class SalesmanOption extends AbstractTool
|
|
{
|
|
protected function script()
|
|
{
|
|
return <<<JS
|
|
$('#today').change(function () {
|
|
var url = "salesman?type=today&option=1"
|
|
Dcat.reload(url);
|
|
});
|
|
$('#yesterday').change(function () {
|
|
var url = "salesman?type=yesterday&option=-1"
|
|
|
|
Dcat.reload(url);
|
|
});
|
|
$('#week').change(function () {
|
|
var url = "salesman?type=week&option=w"
|
|
|
|
Dcat.reload(url);
|
|
});
|
|
$('#month').change(function () {
|
|
var url = "salesman?type=month&option=30"
|
|
|
|
Dcat.reload(url);
|
|
});
|
|
JS;
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
Admin::script($this->script());
|
|
// $options = [
|
|
// 't' => '今日',
|
|
// 'y' => '昨日',
|
|
// 'w' => '本周',
|
|
// 'm' => '本月',
|
|
// ];
|
|
$options = [
|
|
'all' => 'All',
|
|
'm' => 'Male',
|
|
'f' => 'Female',
|
|
];
|
|
|
|
return view('admin.tools.salesman', compact('options'));
|
|
}
|
|
}
|