交友卡关系 创建小房间失败继续进行
This commit is contained in:
@@ -8,10 +8,11 @@ class Friend extends BaseCom
|
|||||||
{
|
{
|
||||||
//交友开始
|
//交友开始
|
||||||
public function start_friend(){
|
public function start_friend(){
|
||||||
|
$key_name = "api:friend:start_friend:" . $this->uid;
|
||||||
|
redis_lock_exits($key_name);
|
||||||
$room_id = input('room_id', '');
|
$room_id = input('room_id', '');
|
||||||
|
|
||||||
$reslut = model('Friend')->start_friend($this->uid,$room_id);
|
$reslut = model('Friend')->start_friend($this->uid,$room_id);
|
||||||
|
redis_unlocks($key_name);
|
||||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,14 +41,15 @@ class Friend extends BaseCom
|
|||||||
//卡关系 创建关系
|
//卡关系 创建关系
|
||||||
public function create_relation()
|
public function create_relation()
|
||||||
{
|
{
|
||||||
|
$key_name = "api:friend:create_relation:" . $this->uid;
|
||||||
|
redis_lock_exits($key_name);
|
||||||
$room_id = input('room_id', '');
|
$room_id = input('room_id', '');
|
||||||
$friend_id = input('friend_id', '');
|
$friend_id = input('friend_id', '');
|
||||||
$user1_id = input('user1_id', '');
|
$user1_id = input('user1_id', '');
|
||||||
$user2_id = input('user2_id', '');
|
$user2_id = input('user2_id', '');
|
||||||
$relation_id = input('relation_id', '');
|
$relation_id = input('relation_id', '');
|
||||||
|
|
||||||
$result = model('Friend')->createRelation($this->uid,$room_id,$friend_id,$user1_id,$user2_id,$relation_id);
|
$result = model('Friend')->createRelation($this->uid,$room_id,$friend_id,$user1_id,$user2_id,$relation_id);
|
||||||
|
redis_unlocks($key_name);
|
||||||
return V($result['code'], $result['msg'], $result['data']);
|
return V($result['code'], $result['msg'], $result['data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
use think\Cache;
|
use think\Cache;
|
||||||
use think\Db;
|
use think\Db;
|
||||||
use think\exception\HttpResponseException;
|
use think\exception\HttpResponseException;
|
||||||
|
use think\Log;
|
||||||
use think\Response;
|
use think\Response;
|
||||||
|
|
||||||
if (!function_exists('__')) {
|
if (!function_exists('__')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user