点唱房
This commit is contained in:
@@ -266,7 +266,7 @@ class Room extends BaseCom
|
||||
public function change_room_type()
|
||||
{
|
||||
$room_id = input('room_id', 0);
|
||||
$type = input('type', 1);//1-点唱,2-拍卖,3-男神,4-女神,7-交友
|
||||
$type = input('type', 1);//1-聊天,2-拍卖,7-互娱,8-交友,9-点唱
|
||||
$reslut = model('Room')->change_room_type($this->uid, $room_id, $type);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
99
application/api/controller/SingerSong.php
Normal file
99
application/api/controller/SingerSong.php
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\controller\BaseCom;
|
||||
use think\Db;
|
||||
|
||||
class SingerSong extends BaseCom
|
||||
{
|
||||
|
||||
//歌手认证
|
||||
public function singerAuth()
|
||||
{
|
||||
//试音地址
|
||||
$song = input('song', 0);
|
||||
if (!$song) {
|
||||
return V(0, '请上传试音地址');
|
||||
}
|
||||
|
||||
$reslut = model('SingerSong')->singerAuth($this->uid, $song);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
|
||||
//歌手添加歌曲
|
||||
public function singerAddSong()
|
||||
{
|
||||
$song_name = input('song_name', 0);
|
||||
if (!$song_name) {
|
||||
return V(0, '请输入歌曲名称');
|
||||
}
|
||||
$gift_id = input('gift_id', 0);
|
||||
if (!$gift_id) {
|
||||
return V(0, '请选择礼物');
|
||||
}
|
||||
$gift_num = input('gift_num', 1);
|
||||
$reslut = model('SingerSong')->singerAddSong($this->uid, $song_name, $gift_id, $gift_num);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
|
||||
//歌手删除 歌曲
|
||||
public function singerDelSong()
|
||||
{
|
||||
$id = input('id', 0);
|
||||
if (!$id) {
|
||||
return V(0, '请选择歌曲');
|
||||
}
|
||||
$reslut = db::name('vs_singer_song')->where(['id' => $id])->update(['deletetime' => time()]);
|
||||
if ($reslut) {
|
||||
return V(1, '删除成功');
|
||||
} else {
|
||||
return V(0, '删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//歌手修改歌曲
|
||||
public function singerEditSong()
|
||||
{
|
||||
$id = input('id', 0);
|
||||
if (!$id) {
|
||||
return V(0, '请选择歌曲');
|
||||
}
|
||||
$song_name = input('song_name', 0);
|
||||
if (!$song_name) {
|
||||
return V(0, '请输入歌曲名称');
|
||||
}
|
||||
$gift_id = input('gift_id', 0);
|
||||
if (!$gift_id) {
|
||||
return V(0, '请选择礼物');
|
||||
}
|
||||
$gift_num = input('gift_num', 1);
|
||||
$reslut = db::name('vs_singer_song')->where(['id' => $id])->update([
|
||||
'song_name' => $song_name,
|
||||
'gift_id' => $gift_id,
|
||||
'gift_num' => $gift_num,
|
||||
]);
|
||||
if ($reslut) {
|
||||
return V(1, '修改成功');
|
||||
} else {
|
||||
return V(0, '修改失败');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//获取房间内麦位上歌手歌曲
|
||||
public function getSong()
|
||||
{
|
||||
$room_id = input('room_id', 0);
|
||||
if (!$room_id) {
|
||||
return V(0, '请选择房间');
|
||||
}
|
||||
//用户ID
|
||||
$reslut = model('SingerSong')->getSong($this->uid, $room_id);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user