|
|
|
@ -14,7 +14,7 @@ class PromoteGradeController extends BaseController
|
|
|
|
|
parent::_initialize();
|
|
|
|
|
|
|
|
|
|
$loginPromote = $this->getLoginPromote();
|
|
|
|
|
if((C('APP_ENV') == 'dev' || $loginPromote['company_id'] == 334) && $loginPromote['level'] <= 2) {
|
|
|
|
|
if(C('APP_ENV') == 'dev' || $loginPromote['company_id'] == 334) {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
return $this->error('您没有权限');
|
|
|
|
@ -88,6 +88,8 @@ class PromoteGradeController extends BaseController
|
|
|
|
|
|
|
|
|
|
public function settings()
|
|
|
|
|
{
|
|
|
|
|
$this->checkSettingPermission();
|
|
|
|
|
|
|
|
|
|
$loginPromote = $this->getLoginPromote();
|
|
|
|
|
$items = M('promote_grade_setting', 'tab_')->where(['company_id' => $loginPromote['company_id']])->select();
|
|
|
|
|
|
|
|
|
@ -135,8 +137,8 @@ class PromoteGradeController extends BaseController
|
|
|
|
|
|
|
|
|
|
public function setting()
|
|
|
|
|
{
|
|
|
|
|
$this->checkSettingPermission();
|
|
|
|
|
$id = I('id', 0);
|
|
|
|
|
|
|
|
|
|
$setting = null;
|
|
|
|
|
if ($id > 0) {
|
|
|
|
|
$setting = M('promote_grade_setting', 'tab_')->where(['id' => $id])->find();
|
|
|
|
@ -152,6 +154,7 @@ class PromoteGradeController extends BaseController
|
|
|
|
|
|
|
|
|
|
public function delete()
|
|
|
|
|
{
|
|
|
|
|
$this->checkSettingPermission();
|
|
|
|
|
$id = I('id', 0);
|
|
|
|
|
if ($id == 0) {
|
|
|
|
|
return $this->error('记录不存在');
|
|
|
|
@ -167,6 +170,8 @@ class PromoteGradeController extends BaseController
|
|
|
|
|
|
|
|
|
|
public function saveSetting()
|
|
|
|
|
{
|
|
|
|
|
$this->checkSettingPermission();
|
|
|
|
|
|
|
|
|
|
$params = I('post.');
|
|
|
|
|
$loginPromote = $this->getLoginPromote();
|
|
|
|
|
$promoteGradeService = new PromoteGradeService();
|
|
|
|
@ -177,4 +182,12 @@ class PromoteGradeController extends BaseController
|
|
|
|
|
return $this->error($e->getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function checkSettingPermission()
|
|
|
|
|
{
|
|
|
|
|
$loginPromote = $this->getLoginPromote();
|
|
|
|
|
if ($loginPromote['level'] > 2) {
|
|
|
|
|
return $this->error('您没有权限');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|