...
|
...
|
@@ -285,7 +285,17 @@ class ActivityController extends AdminBaseController |
|
|
->alias('j')
|
|
|
->join('volunteer v','v.user_id=j.user_id')
|
|
|
->where($map)
|
|
|
->select();
|
|
|
->select()
|
|
|
->toArray();
|
|
|
foreach ($join as $k=>$v){
|
|
|
if (!empty($v['add_time'])){
|
|
|
$join[$k]['add_time']=date('Y-m-d H:i:s',$v['add_time']);
|
|
|
}
|
|
|
if (!empty($v['sgin_time'])){
|
|
|
$join[$k]['sgin_time']=date('Y-m-d H:i:s',$v['sgin_time']);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->assign('data',$join);
|
|
|
return $this->fetch();
|
|
|
}
|
...
|
...
|
@@ -334,7 +344,8 @@ class ActivityController extends AdminBaseController |
|
|
*/
|
|
|
public function joinTime(){
|
|
|
$map['id']=input('id');
|
|
|
\db('join')->where($map)->find();
|
|
|
$info=\db('join')->where($map)->find();
|
|
|
$this->assign('info',$info);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
...
|
...
|
@@ -346,6 +357,7 @@ class ActivityController extends AdminBaseController |
|
|
public function joinTimePost(){
|
|
|
$map['id']=input('id');
|
|
|
$data['work_time']=input('work_time');
|
|
|
|
|
|
$result=\db('join')->where($map)->update($data);
|
|
|
/*更新用户使用时间*/
|
|
|
$join=\db('join')->where($map)->find();
|
...
|
...
|
@@ -353,12 +365,12 @@ class ActivityController extends AdminBaseController |
|
|
$all_map['user_id']=$user_id;
|
|
|
$all_result=\db('join')->where($all_map)->sum('work_time');
|
|
|
//dump($all_result);
|
|
|
\db('user')->where('user_id',$user_id)->update(['work_time'=>$all_result]);
|
|
|
\db('volunteer')->where('user_id',$user_id)->update(['work_time'=>$all_result]);
|
|
|
|
|
|
if ($result>0){
|
|
|
$this->success('编辑成功!');
|
|
|
}else{
|
|
|
$this->error('编辑失败!');
|
|
|
$this->error('时长没有变化!');
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|