作者 潘浩文

个人中心接口设计

... ... @@ -192,6 +192,18 @@ class IndexController extends RestBaseController
$data['thumbnail'][$k] = cmf_get_image_preview_url($data['thumbnail'][$k]);
}
}
//计算年龄
$byear=date('Y',$item['birthday']);
$bmonth=date('m',$item['birthday']);
$bday=date('d',$item['birthday']);
$tyear=date('Y');
$tmonth=date('m');
$tday=date('d');
$age=$tyear-$byear;
if($bmonth>$tmonth || $bmonth==$tmonth && $bday>$tday){
$age--;
}
$data['age']=$age;
//是否允许通过电话联系
$re1 = Db::name('contact_order')->where(['user_id' => $userId, 'post_id' => $param['id'], 'status' => 2])->find();
$re2 = Db::name('order')->where(['user_id' => $userId, 'post_id' => $param['id']])->whereNotIn('to_user_status',[1,5,3])->find();
... ...