后台会员级别及会员权益关联入会类型
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -20,11 +20,16 @@ use app\common\controller\Backend;
|
||||
*/
|
||||
class Rights extends Backend
|
||||
{
|
||||
protected $join_config_model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\wdsxh\member\MemberBenefits();
|
||||
$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'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,12 @@ class JoinConfig extends Model
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function getSimpleByStatus($status = 'normal')
|
||||
{
|
||||
return Self::field(['id', 'name'])->where(function($query) use ($status) {
|
||||
if (null !== $status) {
|
||||
$query->where('status', '=', $status);
|
||||
}
|
||||
})->order('weigh', 'asc')->select();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,8 +27,9 @@
|
||||
<label class="control-label col-xs-12 col-sm-2">入会类型:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<select id="input-group" name="row[join_config_id]" class="selectpicker form-control" placeholder="请选择入会类型" >
|
||||
<option value="1">个人会员</option>
|
||||
<option value="2">单位会员</option>
|
||||
{foreach $join_config as $item}
|
||||
<option value="{$item.id}">{$item.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,8 +27,9 @@
|
||||
<label class="control-label col-xs-12 col-sm-2">入会类型:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<select id="input-group" name="row[join_config_id]" class="selectpicker form-control" placeholder="请选择入会类型" >
|
||||
<option value="1" {eq name="row.join_config_id" value="1"}checked{/eq}>个人会员</option>
|
||||
<option value="2" {eq name="row.join_config_id" value="2"}checked{/eq}>单位会员</option>
|
||||
{foreach $join_config as $item}
|
||||
<option value="{$item.id}" {eq name="row.join_config_id" value="$item.id"}selected{/eq}>{$item.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
<label class="control-label col-xs-12 col-sm-2">入会类型:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<select id="input-group" name="row[join_config_id]" class="selectpicker form-control" placeholder="请选择入会类型" >
|
||||
<option value="1">个人会员</option>
|
||||
<option value="2">单位会员</option>
|
||||
{foreach $join_config as $item}
|
||||
<option value="{$item.id}">{$item.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
<label class="control-label col-xs-12 col-sm-2">入会类型:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<select id="input-group" name="row[join_config_id]" class="selectpicker form-control" placeholder="请选择入会类型" >
|
||||
<option value="1" {eq name="row.join_config_id" value="1"}checked{/eq}>个人会员</option>
|
||||
<option value="2" {eq name="row.join_config_id" value="2"}checked{/eq}>单位会员</option>
|
||||
{foreach $join_config as $item}
|
||||
<option value="{$item.id}" {eq name="row.join_config_id" value="$item.id"}selected{/eq}>{$item.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user