酒吧房:->相关接口提交
This commit is contained in:
45
application/api/controller/BarRoom.php
Normal file
45
application/api/controller/BarRoom.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\controller\BaseCom;
|
||||
use think\Db;
|
||||
|
||||
class BarRoom extends BaseCom
|
||||
{
|
||||
|
||||
//麦位时长列表
|
||||
public function get_pit_time_list(){
|
||||
$reslut = model('BarRoom')->get_pit_duration_list();
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
//房间麦位时长设置
|
||||
public function set_pit_time(){
|
||||
$room_id = input('room_id', 0);
|
||||
$time = input('time', 0);
|
||||
$user_id = $this->uid;
|
||||
if (!$room_id || !$time) {
|
||||
return V(0, '参数错误');
|
||||
}
|
||||
//判断用户是否是主持
|
||||
$room_user_info = db::name('vs_room_host')->where(['room_id' => $room_id, 'user_id' => $user_id,'delete_time' => 0])->find();
|
||||
if($room_user_info){
|
||||
$user_is_on_pit = db::name('vs_room_pit')->where(['room_id' => $room_id, 'user_id' => $user_id])->value('pit_number');
|
||||
if($user_is_on_pit != 9){
|
||||
return V(0, '您不是在麦主持');
|
||||
}
|
||||
}else{
|
||||
return V(0, '您不是主持');
|
||||
}
|
||||
$reslut = model('BarRoom')->set_pit_duration($room_id, $time);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//约Ta礼物详情
|
||||
public function get_gift_info_ta(){
|
||||
$room_id = input('room_id', 0);
|
||||
$to_user_id =input('to_user_id', 0);
|
||||
$reslut = model('BarRoom')->get_gift_info_ta($room_id, $to_user_id);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user