后台会员级别及会员权益关联入会类型

This commit is contained in:
2026-04-25 14:20:30 +08:00
parent 3e735efd23
commit a9751ef42c
7 changed files with 45 additions and 22 deletions

View File

@@ -35,13 +35,15 @@ class Level extends Backend
protected $model = null;
protected $modelValidate = true;
protected $pay_method = null;
protected $member_benefit_model = null;
protected $benefit_model = null;
protected $join_config_model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\wdsxh\member\Level;
$this->member_benefit_model = new \app\admin\model\wdsxh\member\MemberBenefits;
$this->benefit_model = new \app\admin\model\wdsxh\member\MemberBenefits;
$this->join_config_model = new \app\admin\model\wdsxh\member\JoinConfig;
$this->view->assign("statusList", $this->model->getStatusList());
$pay_method = (new FeesConfig())->where('id',1)->value('pay_method');
$this->pay_method = $pay_method;
@@ -114,8 +116,12 @@ class Level extends Backend
public function add()
{
if (false === $this->request->isPost()) {
$benefits = $this->member_benefit_model->getSimpleByStatus(0);
$benefits = $this->benefit_model->getSimpleByStatus(0);
$this->view->assign('benefits', $benefits);
$join_config = $this->join_config_model->getSimpleByStatus();
$this->view->assign('join_config', $join_config);
return $this->view->fetch();
}
$params = $this->request->post('row/a');
@@ -170,11 +176,14 @@ class Level extends Backend
$this->error(__('You have no permission'));
}
if (false === $this->request->isPost()) {
$benefits = $this->member_benefit_model->getSimpleByStatus(0);
$benefits = $this->benefit_model->getSimpleByStatus(0);
$this->view->assign('benefits', $benefits);
if (is_null($row['benefits_id'])) {
$row['benefits_id'] = [];
}
$join_config = $this->join_config_model->getSimpleByStatus();
$this->view->assign('join_config', $join_config);
$this->view->assign('row', $row);
return $this->view->fetch();
}