作者 潘浩文

修改意见

... ... @@ -428,20 +428,24 @@ class SignController extends RestBaseController
foreach ($data as $k=>$v){
$data[$k]['week']=ceil(($data[$k]['create_time'] - $user['register_time'])/(7*24*60*60));
$data[$k]['week_time']=date('m-d',strtotime('+'.$data[$k]['week'].' week',$data[$k]['create_time']));
if ($paramService->status($user['before_weight'],$user['height'])=='正常'){
if ($user['pregnant_week']+$data[$k]['week']>12){
$data[$k]['biaozhun']=$user['before_weight']+1.25+($user['pregnant_week']+$data[$k]['week']-12)*(0.36+0.45)/2;
}elseif ($user['pregnant_week']+$data[$k]['week']<=12){
$data[$k]['biaozhun']=$user['before_weight']+1.25;
}
if ($user['pregnant_week']+$data[$k]['week']<=12){
$data[$k]['shangxian']=$user['before_weight']+2;
$data[$k]['xiaxian']=$user['before_weight']+0.5;
}else{
if ($paramService->status($user['before_weight'],$user['height'])=='正常') {
$data[$k]['shangxian']=$user['before_weight']+2+($user['pregnant_week']+$data[$k]['week']-12)*0.45;
$data[$k]['xiaxian']=$user['before_weight']+0.5+($user['pregnant_week']+$data[$k]['week']-12)*0.36;
}elseif ($paramService->status($user['before_weight'],$user['height'])=='偏瘦'){
$data[$k]['biaozhun']=$user['before_weight']+1.25+($user['pregnant_week']+$data[$k]['week']-12)*(0.45+0.59)/2;
$data[$k]['shangxian']=$user['before_weight']+2+($user['pregnant_week']+$data[$k]['week']-12)*0.59;
$data[$k]['xiaxian']=$user['before_weight']+0.5+($user['pregnant_week']+$data[$k]['week']-12)*0.45;
}elseif ($paramService->status($user['before_weight'],$user['height'])=='肥胖'){
$data[$k]['biaozhun']=$user['before_weight']+1.25+($user['pregnant_week']+$data[$k]['week']-12)*(0.18+0.27)/2;
$data[$k]['shangxian']=$user['before_weight']+2+($user['pregnant_week']+$data[$k]['week']-12)*0.32;
$data[$k]['xiaxian']=$user['before_weight']+0.5+($user['pregnant_week']+$data[$k]['week']-12)*0.23;
}elseif ($paramService->status($user['before_weight'],$user['height'])=='超重'){
$data[$k]['biaozhun']=$user['before_weight']+1.25+($user['pregnant_week']+$data[$k]['week']-12)*(0.23+0.32)/2;
$data[$k]['shangxian']=$user['before_weight']+2+($user['pregnant_week']+$data[$k]['week']-12)*0.27;
$data[$k]['xiaxian']=$user['before_weight']+0.5+($user['pregnant_week']+$data[$k]['week']-12)*0.18;
}
}
}
//返回
$this->success('我的体重数据',[$param,$data]);
... ...