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.
42 lines
876 B
42 lines
876 B
<?php
|
|
|
|
|
|
namespace App\Admin\Actions\Tools;
|
|
|
|
|
|
use Dcat\Admin\Admin;
|
|
use Dcat\Admin\Grid\Tools\AbstractTool;
|
|
|
|
class SalesmanOption extends AbstractTool
|
|
{
|
|
protected function script()
|
|
{
|
|
$url = request()->fullUrlWithQuery(['gender' => '_gender_']);
|
|
|
|
return <<<JS
|
|
$('input:radio.user-gender').change(function () {
|
|
var url = "$url".replace('_gender_', $(this).val());
|
|
|
|
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'));
|
|
}
|
|
}
|