新需求: 盲盒转盘开发-转盘抽奖接口开发
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\controller\BaseCom;
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
|
||||
/*
|
||||
* 盲盒转盘
|
||||
@@ -11,6 +13,12 @@ use app\common\controller\BaseCom;
|
||||
|
||||
class BlindBoxTurntable extends BaseCom
|
||||
{
|
||||
protected function initialize()
|
||||
{
|
||||
//允许跨域
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取活动奖池礼物列表
|
||||
*/
|
||||
@@ -19,4 +27,25 @@ class BlindBoxTurntable extends BaseCom
|
||||
$reslut = model('BlindBoxTurntableGift')->get_gift_list($gift_bag_id);
|
||||
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
/*
|
||||
* 抽奖
|
||||
*
|
||||
*/
|
||||
public function draw_gift(){
|
||||
$gift_bag_id = input('gift_bag_id',0);
|
||||
$user_id = $this->uid;
|
||||
$room_id = input('room_id',0);
|
||||
$gift_user_ids = input('gift_user_ids',0);
|
||||
$num = input('num',1);
|
||||
$reslut = model('BlindBoxTurntableGift')->draw_gift($gift_bag_id, $user_id, $gift_user_ids,$num,$room_id);
|
||||
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
/*
|
||||
* 礼物发放
|
||||
*/
|
||||
public function gift_send(){
|
||||
$send_id = input('send_id',0);
|
||||
$reslut = model('BlindBoxTurntableGift')->gift_send($send_id);
|
||||
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user