sth
This commit is contained in:
parent
3af4172660
commit
d598ecbde2
|
|
@ -9,6 +9,7 @@ use think\Exception;
|
||||||
use think\exception\DbException;
|
use think\exception\DbException;
|
||||||
use think\exception\PDOException;
|
use think\exception\PDOException;
|
||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
|
use think\response\Json;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务记录
|
* 任务记录
|
||||||
|
|
@ -40,6 +41,40 @@ class Dispatchrecord extends Backend
|
||||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看
|
||||||
|
*
|
||||||
|
* @return string|Json
|
||||||
|
* @throws \think\Exception
|
||||||
|
* @throws DbException
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//设置过滤方法
|
||||||
|
$this->request->filter(['strip_tags', 'trim']);
|
||||||
|
|
||||||
|
$dispatch_id = $this->request->get('dispatch_id');
|
||||||
|
|
||||||
|
if (false === $this->request->isAjax()) {
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
//如果发送的来源是 Selectpage,则转发到 Selectpage
|
||||||
|
if ($this->request->request('keyField')) {
|
||||||
|
return $this->selectpage();
|
||||||
|
}
|
||||||
|
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
|
||||||
|
$list = $this->model
|
||||||
|
->where($where)
|
||||||
|
->where('dispatch_id',$dispatch_id)
|
||||||
|
->order($sort, $order)
|
||||||
|
->paginate($limit);
|
||||||
|
$result = ['total' => $list->total(), 'rows' => $list->items()];
|
||||||
|
return json($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user