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