生日选择 不能小于18 岁 创建房间校验修改

This commit is contained in:
2025-12-11 09:27:05 +08:00
parent eba24310bc
commit b2f535be6e
3 changed files with 19 additions and 3 deletions

View File

@@ -65,6 +65,11 @@ class UserData extends Model
}
if (!empty($birthday)) {
//判断 是否成年
$birthday_time = strtotime($birthday);
if(time() - $birthday_time < 18 * 365 * 24 * 60 * 60){
$birthday = '1990-01-01';
}
$data['birthday'] = $birthday;
}
if (!empty($reg_code)) {
@@ -149,6 +154,10 @@ class UserData extends Model
}
}
if (!empty($birthday)) {
$birthday_time = strtotime($birthday);
if(time() - $birthday_time < 18 * 365 * 24 * 60 * 60){
$birthday = '1990-01-01';
}
$data['birthday'] = $birthday;
$constellation = $this->get_user_constellation($birthday);
$data['constellation'] = $constellation['data'];