作者 郭盛
1 个管道 的构建 通过 耗费 13 秒

修改新老师注册时候提醒

... ... @@ -5,6 +5,7 @@ namespace app\admin\controller;
use app\admin\model\AdminLog;
use app\common\controller\Backend;
use think\Config;
use think\Db;
use think\Hook;
use think\Validate;
... ... @@ -31,12 +32,17 @@ class Index extends Backend
*/
public function index()
{
//查出所有待审核老师的个数
$data = Db::name('teacher')
->where('status',0)
->count();
//左侧菜单
list($menulist, $navlist, $fixedmenu, $referermenu) = $this->auth->getSidebar([
'dashboard' => 'hot',
'addon' => ['new', 'red', 'badge'],
'auth/rule' => __('Menu'),
'general' => ['new', 'purple'],
'teacher' =>[$data,'red']
], $this->view->site['fixedpage']);
$action = $this->request->request('action');
if ($this->request->isPost()) {
... ...
... ... @@ -23,6 +23,7 @@ class Teacher extends Backend
{
parent::_initialize();
$this->model = new \app\admin\model\Teacher;
$this->view->assign("statusList", $this->model->getStatusList());
}
... ... @@ -120,9 +121,11 @@ class Teacher extends Backend
->where('status',1)
->where('is_recommend',1)
->where('is_stick',1)
->count();
if($teacher_list >= 3){
$this->error('已有三个置顶老师');
->column('id');
if(!in_array($ids,$teacher_list)){
if(count($teacher_list) >= 3){
$this->error('已有三个置顶老师');
}
}
}
$result = false;
... ...
... ... @@ -27,9 +27,12 @@ class Teacher extends Model
protected $append = [
'onlinetime_text'
];
public function getStatusList()
{
return ['0' => __('待审核'),'1' => __('审核通过'),'2'=>__('未通过')];
}
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="status">
<li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="statusList" item="vo"}
<li><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
... ...