www.maiwd.cn // +---------------------------------------------------------------------- namespace app\admin\controller\wdsxh\member; use app\common\controller\Backend; /** * 会员列表 * * @icon fa fa-circle-o */ class RightsProject extends Backend { protected $join_config_model = null; public function _initialize() { parent::_initialize(); $this->model = new \app\admin\model\wdsxh\member\MemberBenefitsProject(); $this->searchFields = ['title']; } protected $beforeActionList = [ 'statusList' => ['only'=>'index'], 'joinConfig' => ['only'=>'add,edit'], ]; protected function statusList() { $this->view->assign("statusList", $this->model->getDisabledList()); } protected function joinConfig() { $this->join_config_model = new \app\admin\model\wdsxh\member\JoinConfig(); $this->view->assign('join_config', $this->join_config_model->getSimpleByStatus()); } public function index() { $this->request->filter(['strip_tags', 'trim']); 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 ->with(['joinConfig']) ->where($where) ->order($sort, $order) ->paginate($limit); $result = ['total' => $list->total(), 'rows' => $list->items()]; return json($result); } }