|
@@ -1586,29 +1586,43 @@ class Party extends Common
|
|
* 全麦/单独赠送礼物
|
|
* 全麦/单独赠送礼物
|
|
*/
|
|
*/
|
|
public function giveGiftToYou() {
|
|
public function giveGiftToYou() {
|
|
- $is_back = $this->request->request("is_back",0);// 是否背包赠送: 1=是,0=否
|
|
|
|
|
|
+ // 是否背包赠送: 1=是,0=否
|
|
|
|
+ $is_back = $this->request->request("is_back",0);
|
|
|
|
|
|
// 接口防并发
|
|
// 接口防并发
|
|
if($is_back){
|
|
if($is_back){
|
|
if (!$this->apiLimit(50, 1000)) {
|
|
if (!$this->apiLimit(50, 1000)) {
|
|
|
|
+ //1000毫秒50次
|
|
$this->error(__('Operation frequently'));
|
|
$this->error(__('Operation frequently'));
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
if (!$this->apiLimit(10, 1000)) {
|
|
if (!$this->apiLimit(10, 1000)) {
|
|
|
|
+ //1000毫秒10次
|
|
$this->error(__('Operation frequently'));
|
|
$this->error(__('Operation frequently'));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //送礼物权限
|
|
|
|
+ if($this->auth->power['give_gift'] == 1){
|
|
|
|
+ $this->error('您已被限制:赠送礼物,请联系管理员');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //接收参数
|
|
$user_ids = $this->request->request("user_id");// 赠送对象
|
|
$user_ids = $this->request->request("user_id");// 赠送对象
|
|
- $gift_id = $this->request->request("gift_id");// 礼物ID
|
|
|
|
|
|
+ $gift_id = $this->request->request("gift_id");// 礼物ID。如果是背包赠送,则是gift_back表的id,这样不合理,但是已经不好改了
|
|
$party_id = $this->request->request("party_id",0);// 派对ID
|
|
$party_id = $this->request->request("party_id",0);// 派对ID
|
|
$room_type = $this->request->request('room_type',1); // 房间类型
|
|
$room_type = $this->request->request('room_type',1); // 房间类型
|
|
$number = $this->request->request("number");// 赠送数量
|
|
$number = $this->request->request("number");// 赠送数量
|
|
|
|
|
|
- if (!$user_ids || !in_array($is_back,[0,1]) || !$gift_id || !$number || !in_array($room_type,[1,2])) $this->error(__('Invalid parameters'));
|
|
|
|
|
|
+ if (!$user_ids || !in_array($is_back,[0,1]) || !$gift_id || !$number || !in_array($room_type,[1,2]))
|
|
|
|
+ {
|
|
|
|
+ $this->error(__('Invalid parameters'));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //处理参数
|
|
$user_id_arr = explode(",",$user_ids);
|
|
$user_id_arr = explode(",",$user_ids);
|
|
$userCount = count($user_id_arr);
|
|
$userCount = count($user_id_arr);
|
|
$userauthid = $this->auth->id;
|
|
$userauthid = $this->auth->id;
|
|
- //$soundCoinRate = config("site.giftCoin"); // 声币兑换比例
|
|
|
|
$money_to_jewel = config('site.money_to_jewel') ?: 10; //余额兑换钻石
|
|
$money_to_jewel = config('site.money_to_jewel') ?: 10; //余额兑换钻石
|
|
$userModel = new \app\common\model\User();
|
|
$userModel = new \app\common\model\User();
|
|
|
|
|