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

修改意见

@@ -428,6 +428,20 @@ class SignController extends RestBaseController @@ -428,6 +428,20 @@ class SignController extends RestBaseController
428 foreach ($data as $k=>$v){ 428 foreach ($data as $k=>$v){
429 $data[$k]['week']=ceil(($data[$k]['create_time'] - $user['register_time'])/(7*24*60*60)); 429 $data[$k]['week']=ceil(($data[$k]['create_time'] - $user['register_time'])/(7*24*60*60));
430 $data[$k]['week_time']=date('m-d',strtotime('+'.$data[$k]['week'].' week',$data[$k]['create_time'])); 430 $data[$k]['week_time']=date('m-d',strtotime('+'.$data[$k]['week'].' week',$data[$k]['create_time']));
  431 + if ($paramService->status($user['before_weight'],$user['height'])=='正常'){
  432 + if ($user['pregnant_week']+$data[$k]['week']>12){
  433 + $data[$k]['biaozhun']=$user['before_weight']+1.25+($user['pregnant_week']+$data[$k]['week']-12)*(0.36+0.45)/2;
  434 + }elseif ($user['pregnant_week']+$data[$k]['week']<=12){
  435 + $data[$k]['biaozhun']=$user['before_weight']+1.25;
  436 + }
  437 + }elseif ($paramService->status($user['before_weight'],$user['height'])=='偏瘦'){
  438 + $data[$k]['biaozhun']=$user['before_weight']+1.25+($user['pregnant_week']+$data[$k]['week']-12)*(0.45+0.59)/2;
  439 + }elseif ($paramService->status($user['before_weight'],$user['height'])=='肥胖'){
  440 + $data[$k]['biaozhun']=$user['before_weight']+1.25+($user['pregnant_week']+$data[$k]['week']-12)*(0.18+0.27)/2;
  441 + }elseif ($paramService->status($user['before_weight'],$user['height'])=='超重'){
  442 + $data[$k]['biaozhun']=$user['before_weight']+1.25+($user['pregnant_week']+$data[$k]['week']-12)*(0.23+0.32)/2;
  443 + }
  444 +
431 } 445 }
432 //返回 446 //返回
433 $this->success('我的体重数据',[$param,$data]); 447 $this->success('我的体重数据',[$param,$data]);