Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
66
application/api/controller/Friend.php
Normal file
66
application/api/controller/Friend.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\controller\BaseCom;
|
||||
|
||||
class Friend extends BaseCom
|
||||
{
|
||||
//交友开始
|
||||
public function start_friend(){
|
||||
$room_id = input('room_id', '');
|
||||
|
||||
$reslut = model('Friend')->start_friend($this->uid,$room_id);
|
||||
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//交友延时
|
||||
public function delay(){
|
||||
$friend_id = input('friend_id', '');
|
||||
$room_id = input('room_id', '');
|
||||
$delay_times = input('delay_times', '');//分钟
|
||||
|
||||
$reslut = model('Friend')->delay($this->uid,$room_id,$friend_id,$delay_times);
|
||||
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//交友结束
|
||||
public function end_friend(){
|
||||
|
||||
$friend_id = input('friend_id', '');
|
||||
$room_id = input('room_id', '');
|
||||
|
||||
$result = model('Friend')->end_friend($this->uid,$room_id,$friend_id);
|
||||
if($result['code'] == 1){
|
||||
model('Room')->clear_user_charm($this->uid, $room_id);
|
||||
}
|
||||
|
||||
return V($result['code'], $result['msg'], $result['data']);
|
||||
}
|
||||
|
||||
//卡关系 创建关系
|
||||
public function create_relation()
|
||||
{
|
||||
$room_id = input('room_id', '');
|
||||
$friend_id = input('friend_id', '');
|
||||
$user1_id = input('user1_id', '');
|
||||
$user2_id = input('user2_id', '');
|
||||
$relation_id = input('relation_id', '');
|
||||
|
||||
$result = model('Friend')->createRelation($this->uid,$room_id,$friend_id,$user1_id,$user2_id,$relation_id);
|
||||
|
||||
return V($result['code'], $result['msg'], $result['data']);
|
||||
}
|
||||
|
||||
//退出私密小屋
|
||||
public function out_room()
|
||||
{
|
||||
$room_id = input('room_id', '');
|
||||
|
||||
$result = model('Friend')->outRoom($this->uid,$room_id);
|
||||
|
||||
return V($result['code'], $result['msg'], $result['data']);
|
||||
}
|
||||
}
|
||||
@@ -155,8 +155,9 @@ class Room extends BaseCom
|
||||
$to_uid = input('to_uid', 0);//收礼人ID,逗号隔开的字符串
|
||||
$type = input('type', 1);//1金币购买 2送背包礼物
|
||||
$pit_number = input('pit_number', 0);
|
||||
$heart_id = input('heart_id', 0);
|
||||
|
||||
$reslut = model('Room')->room_gift($this->uid, $to_uid, $gift_id, $gift_num, $type, $room_id, $pit_number);
|
||||
$reslut = model('Room')->room_gift($this->uid, $to_uid, $gift_id, $gift_num, $type, $room_id, $pit_number,$heart_id);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user