...
|
...
|
@@ -769,7 +769,9 @@ class ActivityController extends AdminBaseController |
|
|
|
|
|
public function addtime(){
|
|
|
$id=input('id');
|
|
|
$user_id=input('user_id');
|
|
|
$this->assign('id',$id);
|
|
|
$this->assign('user_id',$user_id);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
...
|
...
|
@@ -777,24 +779,33 @@ class ActivityController extends AdminBaseController |
|
|
public function addtimepost(){
|
|
|
$id=input('id');
|
|
|
$time=input('time');
|
|
|
$map['activity_id']=$id;
|
|
|
$map['status']=['in','1,3'];
|
|
|
$map['delete_time']=0;
|
|
|
$join=\db('join')->where($map)->select();
|
|
|
foreach ($join as $k=>$v){
|
|
|
/*是否已经设置过时间*/
|
|
|
if (empty($v['work_time'])){
|
|
|
/*添加用户时间和活动时间*/
|
|
|
\db('join')->where('id',$v['id'])->update(['work_time'=>$time]);
|
|
|
\db('volunteer')->where('user_id',$v['user_id'])->setInc('work_time',$time);
|
|
|
$flag=1;
|
|
|
}
|
|
|
}
|
|
|
if (isset($flag)){
|
|
|
$user_id=input('user_id');
|
|
|
$map['activity_id']=$id;
|
|
|
// $map['status']=['in','1,3'];
|
|
|
// $map['delete_time']=0;
|
|
|
// $join=\db('join')->where($map)->select();
|
|
|
// foreach ($join as $k=>$v){
|
|
|
// /*是否已经设置过时间*/
|
|
|
// if (empty($v['work_time'])){
|
|
|
// /*添加用户时间和活动时间*/
|
|
|
// \db('join')->where('id',$v['id'])->update(['work_time'=>$time]);
|
|
|
// \db('volunteer')->where('user_id',$v['user_id'])->setInc('work_time',$time);
|
|
|
// $flag=1;
|
|
|
// }
|
|
|
// }
|
|
|
$users=explode(',',$user_id);
|
|
|
foreach($users as $k=>$v){
|
|
|
\db('join')->where('id',$v)->update(['work_time'=>$time]);
|
|
|
$info= db('join')->where('id',$v)->find();
|
|
|
\db('volunteer')->where('user_id',$info['user_id'])->setInc('work_time',$time);
|
|
|
$flag=1;
|
|
|
}
|
|
|
$this->success('设置工作时长成功!');
|
|
|
/* if (isset($flag)){
|
|
|
$this->success('设置工作时长成功!');
|
|
|
}else{
|
|
|
$this->error('全部已经确定了工作时长');
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|