mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-07 10:32:48 +08:00
优化databrage操作;
This commit is contained in:
@@ -40,11 +40,10 @@ class Admin extends AdminController
|
|||||||
{
|
{
|
||||||
parent::__construct($app);
|
parent::__construct($app);
|
||||||
$this->model = new SystemAdmin();
|
$this->model = new SystemAdmin();
|
||||||
$this->assign('auth_list', $this->model->getAuthList(),true);
|
$this->assign('auth_list', $this->model->getAuthList(), true);
|
||||||
|
|
||||||
$this->dataBrage['count'] = 10;
|
|
||||||
$this->dataBrage['tips'] = '请谨慎操作';
|
|
||||||
|
|
||||||
|
$this->setDataBrage('count', 10);
|
||||||
|
$this->setDataBrage('tips', '请谨慎操作');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -168,8 +167,8 @@ class Admin extends AdminController
|
|||||||
$row = $this->model->whereIn('id', $id)->select();
|
$row = $this->model->whereIn('id', $id)->select();
|
||||||
$row->isEmpty() && $this->error('数据不存在');
|
$row->isEmpty() && $this->error('数据不存在');
|
||||||
$id == AdminConstant::SUPER_ADMIN_ID && $this->error('超级管理员不允许修改');
|
$id == AdminConstant::SUPER_ADMIN_ID && $this->error('超级管理员不允许修改');
|
||||||
if (is_array($id)){
|
if (is_array($id)) {
|
||||||
if (in_array(AdminConstant::SUPER_ADMIN_ID, $id)){
|
if (in_array(AdminConstant::SUPER_ADMIN_ID, $id)) {
|
||||||
$this->error('超级管理员不允许修改');
|
$this->error('超级管理员不允许修改');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -211,6 +210,4 @@ class Admin extends AdminController
|
|||||||
}
|
}
|
||||||
$this->success('保存成功');
|
$this->success('保存成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class AdminController extends BaseController
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $dataBrage = [];
|
private $dataBrage = [];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -140,6 +140,20 @@ class AdminController extends BaseController
|
|||||||
return $this->app->view->fetch($template, $vars);
|
return $this->app->view->fetch($template, $vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置dataBrage数据
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
* @param mixed $value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setDataBrage($name, $value)
|
||||||
|
{
|
||||||
|
$this->dataBrage[$name] = $value;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重写验证规则
|
* 重写验证规则
|
||||||
* @param array $data
|
* @param array $data
|
||||||
|
|||||||
Reference in New Issue
Block a user