生日选择 不能小于18 岁 创建房间校验修改
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);
|
||||
|
||||
Reference in New Issue
Block a user