后台会员权益项目添加入会类型列
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'Member Benefits Project Join Config Name' => '入会类型',
|
||||
'Member Benefits Project Name' => '权益项目',
|
||||
'Member Benefits Project Sort' => '排序',
|
||||
'Member Benefits Project Status' => '状态',
|
||||
|
||||
@@ -32,6 +32,11 @@ class MemberBenefitsProject extends Model
|
||||
'disabled_text'
|
||||
];
|
||||
|
||||
public function joinConfig()
|
||||
{
|
||||
return $this->hasOne(JoinConfig::class, 'id', 'join_config_id')->bind(['join_config_name' => 'name']);
|
||||
}
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user