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

修改志愿者列表

@@ -1202,6 +1202,7 @@ class SecondController extends RestBaseController @@ -1202,6 +1202,7 @@ class SecondController extends RestBaseController
1202 */ 1202 */
1203 public function endClock(){ 1203 public function endClock(){
1204 $data=input(); 1204 $data=input();
  1205 + $user_id=$this->getUserId();
1205 $activityModel=new ClockModel(); 1206 $activityModel=new ClockModel();
1206 $activity=$activityModel->where('id',$data['id'])->find(); 1207 $activity=$activityModel->where('id',$data['id'])->find();
1207 1208
@@ -1225,7 +1226,10 @@ class SecondController extends RestBaseController @@ -1225,7 +1226,10 @@ class SecondController extends RestBaseController
1225 $update['user_end']=time(); 1226 $update['user_end']=time();
1226 $result=db('clock')->where('id',$data['id'])->update(['user_end'=>$now,'status'=>'2']); 1227 $result=db('clock')->where('id',$data['id'])->update(['user_end'=>$now,'status'=>'2']);
1227 if ($result==1){ 1228 if ($result==1){
1228 - /**/ 1229 + /*添加对应工时*/
  1230 + $info=db('clock')->where('id',$data['id'])->find();
  1231 + $user=new VolunteerModel();
  1232 + $user->where('user_id',$user_id)->setInc('work_time',$info['work_time']);
1229 } 1233 }
1230 $this->success('打卡成功!'); 1234 $this->success('打卡成功!');
1231 } 1235 }