作者 潘浩文
1 个管道 的构建 通过 耗费 0 秒

接口

@@ -361,10 +361,10 @@ class SignController extends RestBaseController @@ -361,10 +361,10 @@ class SignController extends RestBaseController
361 public function weekSignPost(){ 361 public function weekSignPost(){
362 $param=$this->request->param(); 362 $param=$this->request->param();
363 $user=Db::name('user')->where('id',$this->getUserId())->find(); 363 $user=Db::name('user')->where('id',$this->getUserId())->find();
364 - Db::name('user')->where('id',$this->getUserId())->update(['now_weight'=>$param['weight']]); 364 + Db::name('user')->where('id',$user['id'])->update(['now_weight'=>$param['weight']]);
365 $paramService=new ParamService(); 365 $paramService=new ParamService();
366 $param['status']=$paramService->week_status($param['weight'],$user['height']); 366 $param['status']=$paramService->week_status($param['weight'],$user['height']);
367 - Db::name('user_week_sign')->insert(['user_id'=>$this->getUserId(),'create_time'=>time(),'weight'=>$param['weight'],'status'=>$param['status']]); 367 + Db::name('user_week_sign')->insert(['user_id'=>$user['id'],'create_time'=>time(),'weight'=>$param['weight'],'status'=>$param['status']]);
368 //返回 368 //返回
369 $this->success('周打卡提交成功'); 369 $this->success('周打卡提交成功');
370 } 370 }