Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -9,7 +9,7 @@ class Room extends BaseCom
|
||||
{
|
||||
//创建房间前的检测
|
||||
public function check_create_room()
|
||||
{
|
||||
{return V(1, '可以创建房间');
|
||||
//检测用户的签约徒弟
|
||||
$signCount = db::name('vs_user_sign')->where(['parent_user_id' => $this->uid ,'end_time' => ['>', time()]] )->count();
|
||||
if($signCount < 10){
|
||||
@@ -27,6 +27,13 @@ class Room extends BaseCom
|
||||
$room_cover = input('room_cover', '');
|
||||
$room_intro = input('room_intro', '');
|
||||
|
||||
$signCount = db::name('vs_user_sign')->where(['parent_user_id' => $this->uid ,'end_time' => ['>', time()]] )->count();
|
||||
$num = get_system_config_value('sign_num_per_room');
|
||||
if($signCount < $num){
|
||||
$need_sign_num = $num - $signCount;
|
||||
return V(0, '还需签约'.$need_sign_num.'人,才能创建房间!');
|
||||
}
|
||||
|
||||
$key_name = "api:room:user_create_room:" . $this->uid;
|
||||
redis_lock_exits($key_name);
|
||||
$reslut = model('Room')->user_create_room($this->uid, $room_name, $room_cover, $room_intro);
|
||||
|
||||
@@ -15,7 +15,7 @@ class UserData extends BaseCom
|
||||
$key_name = "api:user:follow_user:" . $this->uid;
|
||||
redis_lock_exit($key_name);
|
||||
$nick_name = input('nickname');
|
||||
$birthday = input('birthday');
|
||||
$birthday = input('birthday', '1990-01-01');
|
||||
$sex = input('sex', 0);
|
||||
$head_pic = input('avatar', '');
|
||||
$reg_code = input('init_code', '');
|
||||
@@ -47,7 +47,7 @@ class UserData extends BaseCom
|
||||
$key_name = "api:user:follow_user:" . $this->uid;
|
||||
redis_lock_exit($key_name);
|
||||
$nick_name = input('nick_name');
|
||||
$birthday = input('birthday');
|
||||
$birthday = input('birthday', '1990-01-01');
|
||||
$sex = input('sex', 1);
|
||||
$head_pic = input('head_pic', '');
|
||||
$images = input('images', '');//背景图(以json字符串的形式可以多图)
|
||||
|
||||
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user