12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- namespace app\admin\controller;
- use app\common\controller\Backend;
- class Jiancejoblog extends Backend
- {
-
- protected $model = null;
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new \app\admin\model\Jiancejoblog;
- $this->view->assign("hegeStatusList", $this->model->getHegeStatusList());
- }
-
-
- public function index()
- {
-
- $this->relationSearch = true;
-
- $this->request->filter(['strip_tags', 'trim']);
- if ($this->request->isAjax()) {
-
- if ($this->request->request('keyField')) {
- return $this->selectpage();
- }
- list($where, $sort, $order, $offset, $limit) = $this->buildparams();
- $list = $this->model
- ->with(['jiance','project','worker'])
- ->where($where)
- ->order($sort, $order)
- ->paginate($limit);
- foreach ($list as $row) {
-
- $row->getRelation('jiance')->visible(['bianhao']);
- $row->getRelation('project')->visible(['title']);
- $row->getRelation('worker')->visible(['truename','gonghao','mobile']);
- }
- $result = array("total" => $list->total(), "rows" => $list->items());
- return json($result);
- }
- return $this->view->fetch();
- }
- }
|