作者 sgj
1 个管道 的构建 失败 耗费 4 秒

打卡状态编辑

... ... @@ -20,8 +20,14 @@ class TeamController extends AdminBaseController
* @throws \think\exception\DbException
*/
public function index(){
$teamId=$this->getAdminTeamId();
$param=$this->request->param();
$map=[];
if ($teamId==0){
$map=[];
}else{
$map['id']=$teamId;
}
$data= db('team')->where($map)->order('id desc')->paginate();
$data->appends($param);
$list=$data->items();
... ... @@ -29,6 +35,7 @@ class TeamController extends AdminBaseController
'data'=>$list,
'page'=>$data->render(),
]);
$this->assign('teamId',$teamId);
return $this->fetch();
}
... ... @@ -91,14 +98,16 @@ class TeamController extends AdminBaseController
public function apply_pass(){
$data=input();
$update['status']=$data['status'];
$info=db('team_apply')->where('id',$data['id'])->find();
db('team')->where('id',$info['team_id'])->setInc('people_num');
$info=db('team_apply')->where('id',$data['id'])->update($update);
if (!empty($info)){
$this->success('操作成功!');
}else{
$this->error('操作失败');
}
}
/**
* 添加团队
* @return mixed
... ...
... ... @@ -4,9 +4,9 @@
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="{:url('index')}">打卡列表</a></li>
<li>
<a href="{:url('add')}">打卡添加</a>
</li>
<!--<li>-->
<!--<a href="{:url('add')}">打卡添加</a>-->
<!--</li>-->
</ul>
<!-- <form class="well form-inline margin-top-20" method="post" action="{:url('activity/index')}">
... ...
... ... @@ -4,9 +4,9 @@
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="{:url('index')}">打卡列表</a></li>
<li>
<a href="{:url('add')}">打卡添加</a>
</li>
<!--<li>-->
<!--<a href="{:url('add')}">打卡添加</a>-->
<!--</li>-->
</ul>
<!-- <form class="well form-inline margin-top-20" method="post" action="{:url('activity/index')}">
... ...
... ... @@ -4,8 +4,8 @@
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="{:url('index')}">团队列表</a></li>
<li><a href="{:url('addteam')}">添加团队</a></li>
<li><a href="{:url('user/addteam')}">添加团队管理员</a></li>
<if condition="$teamId==0"><li><a href="{:url('addteam')}">添加团队</a></li>
<li><a href="{:url('user/addteam')}">添加团队管理员</a></li></if>
</ul>
<!-- <form class="well form-inline margin-top-20" method="post" action="{:url('activity/index')}">
关键字:
... ...
... ... @@ -73,6 +73,12 @@ class AdminBaseController extends BaseController
config('view_replace_str', $viewReplaceStr);
}
public function getAdminTeamId(){
$map['id']=cmf_get_current_admin_id();
return \db('user')->where($map)->value('team_id');
}
/**
* 初始化后台菜单
*/
... ...