2026-01-02 17:14:40 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
|
|
|
|
|
|
use app\common\controller\BaseCom;
|
|
|
|
|
|
|
|
|
|
|
|
class GiftNew extends BaseCom
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* 获取礼物列表
|
|
|
|
|
|
* @param int $label 礼物标签
|
|
|
|
|
|
* @param int $type 类型:1-房间送礼礼物,2-排麦设置插麦礼物,3-拍卖位选择拍卖礼物,4-歌手添加歌单礼物,5-动态打赏礼物
|
|
|
|
|
|
* @return array
|
|
|
|
|
|
*/
|
|
|
|
|
|
public function get_gift_list()
|
|
|
|
|
|
{
|
|
|
|
|
|
$key_name = "api:gift_new:get_gift_list:" . $this->uid;
|
|
|
|
|
|
redis_lock_exits($key_name);
|
|
|
|
|
|
$label = input('label', 0);
|
|
|
|
|
|
$type = input('type');
|
|
|
|
|
|
if (empty($type)) {
|
|
|
|
|
|
return V(0, 'type参数错误');
|
|
|
|
|
|
}
|
|
|
|
|
|
$reslut = model('GiftNew')->get_gift_list($this->uid, $type, $label);
|
|
|
|
|
|
redis_unlocks($key_name);
|
|
|
|
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
|
}
|
2026-01-04 19:00:02 +08:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* 酒吧房-自定义礼物设置
|
|
|
|
|
|
*/
|
|
|
|
|
|
public function set_custom_gift(){
|
|
|
|
|
|
$gift_id = input('gift_id', 0);
|
2026-01-06 14:41:42 +08:00
|
|
|
|
$gift_remark_name = input('gift_remark_name', '');
|
|
|
|
|
|
$reslut = model('GiftNew')->set_custom_gift($this->uid, $gift_id, $gift_remark_name);
|
2026-01-04 19:00:02 +08:00
|
|
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
|
|
|
* 获取自定义礼物列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
public function get_custom_gift_list(){
|
2026-01-06 11:57:03 +08:00
|
|
|
|
$user_id = input('user_id', 0); //收礼人用户Id
|
|
|
|
|
|
$reslut = model('GiftNew')->get_custom_gift_list($user_id);
|
2026-01-04 19:00:02 +08:00
|
|
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
|
|
|
|
}
|
2026-01-02 17:14:40 +08:00
|
|
|
|
}
|