123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace app\admin\controller\commission;
- use app\common\controller\Backend;
- use app\common\model\commission\Identity as IdentityModel;
- class Identity extends Backend
- {
- protected $model = null;
- protected $searchFields = 'id,name,agent_type';
-
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new IdentityModel();
- }
- public function index()
- {
- if (!$this->request->isAjax()) {
- return $this->view->fetch();
- }
-
- if ($this->request->request('keyField')) {
- return $this->selectpage();
- }
-
- [$where, $sort, $order, $offset, $limit] = $this->buildparams();
-
- $list = $this->model
- ->where($where)
- ->order($sort, $order)
- ->paginate($limit);
-
- $result = ['total' => $list->total(), 'rows' => $list->items()];
- return json($result);
- }
- }
|