Files
yusheng-php/application/api/controller/GiftNew.php

47 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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']);
}
/*
* 酒吧房-自定义礼物设置
*/
public function set_custom_gift(){
$gift_id = input('gift_id', 0);
$gift_remark_name = input('gift_remark_name', '');
$reslut = model('GiftNew')->set_custom_gift($this->uid, $gift_id, $gift_remark_name);
return V($reslut['code'], $reslut['msg'], $reslut['data']);
}
/*
* 获取自定义礼物列表
*/
public function get_custom_gift_list(){
$user_id = input('user_id', 0); //收礼人用户Id
$reslut = model('GiftNew')->get_custom_gift_list($user_id);
return V($reslut['code'], $reslut['msg'], $reslut['data']);
}
}