后台会员权益项目添加入会类型列

This commit is contained in:
2026-04-29 10:46:19 +08:00
parent b4ab15fae0
commit 0388fafc0f
4 changed files with 48 additions and 4 deletions

View File

@@ -26,10 +26,43 @@ class RightsProject extends Backend
{
parent::_initialize();
$this->model = new \app\admin\model\wdsxh\member\MemberBenefitsProject();
$this->view->assign("statusList", $this->model->getDisabledList());
$this->join_config_model = new \app\admin\model\wdsxh\member\JoinConfig();
$this->view->assign('join_config', $this->join_config_model->getSimpleByStatus());
$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);
}
}