...
|
...
|
@@ -303,4 +303,27 @@ class SignController extends RestBaseController |
|
|
//返回
|
|
|
$this->success('周打卡提交成功');
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 我的体重数据
|
|
|
* @description 我的体重数据接口
|
|
|
* @author panhaowen
|
|
|
* @url /portal/Sign/myWeight
|
|
|
* @method POST
|
|
|
* @header name:XX-Token require:1 default: desc:token
|
|
|
* @return param:各个参数
|
|
|
* @return record:周打卡记录
|
|
|
*/
|
|
|
public function myWeight(){
|
|
|
$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']]);
|
|
|
//返回
|
|
|
$this->success('周打卡提交成功');
|
|
|
}
|
|
|
} |
...
|
...
|
|