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

个人中心接口

@@ -319,12 +319,11 @@ class SignController extends RestBaseController @@ -319,12 +319,11 @@ class SignController extends RestBaseController
319 $user=Db::name('user')->where('id',$this->getUserId())->find(); 319 $user=Db::name('user')->where('id',$this->getUserId())->find();
320 $paramService=new ParamService(); 320 $paramService=new ParamService();
321 $nengliang=$paramService->nengliang($user['before_weight'],$user['height'],$user['weight_level'],$user['pregnant_week'],$user['register_time']); 321 $nengliang=$paramService->nengliang($user['before_weight'],$user['height'],$user['weight_level'],$user['pregnant_week'],$user['register_time']);
322 - $param['day_energy']=$nengliang*0.2/4;  
323 - Db::name('user')->where('id',$this->getUserId())->update(['now_weight'=>$param['weight']]);  
324 - $paramService=new ParamService();  
325 - $param['status']=$paramService->week_status($param['weight'],$user['height']);  
326 - Db::name('user_week_sign')->insert(['user_id'=>$this->getUserId(),'create_time'=>time(),'weight'=>$param['weight'],'status'=>$param['status']]); 322 + $param['day_energy']=$nengliang;
  323 + $param['protein']=$nengliang*0.2/4;
  324 + $param['fat']=$nengliang*0.2/9;
  325 + $param['water']=$nengliang*0.6/4;
327 //返回 326 //返回
328 - $this->success('周打卡提交成功'); 327 + $this->success('周打卡提交成功',$param);
329 } 328 }
330 } 329 }