挚友列表
This commit is contained in:
@@ -301,6 +301,7 @@ class User extends BaseCom
|
||||
public function get_friend_list_more()
|
||||
{
|
||||
$user_id = input('user_id', 0);//用户id
|
||||
$relation_id = input('relation_id', 0);
|
||||
$page = input('page', 1);
|
||||
$page_limit = input('page_limit', 30);
|
||||
$reslut = model('User')->get_friend_list_more($user_id, $page, $page_limit);
|
||||
|
||||
@@ -970,12 +970,14 @@ class User extends Model
|
||||
//获取用户当前所拥有的关系
|
||||
$relation = db::name('vs_relation')->where(['id' => ['>',0],'delete_time' => 0])->page($page,$limit)->select();
|
||||
$return_data = [];
|
||||
$no_cp = [];
|
||||
if($relation){
|
||||
foreach ($relation as $v){
|
||||
$return_data['no_cp']['relation_name'] = $v['name'];
|
||||
$return_data['no_cp']['relation_list'] = $this->relation_card($v['id'],$user_id);
|
||||
foreach ($relation as $k => $v){
|
||||
$no_cp['relation_name'][$k] = $v['name'];
|
||||
$no_cp['relation_list'][$k] = $this->relation_card($v['id'],$user_id);
|
||||
}
|
||||
}
|
||||
$return_data['no_cp'] = $no_cp;
|
||||
|
||||
//CP 信息
|
||||
$res = Db::name('user_cp_zone')->where(['user_id1' => $user_id,'status' => 1])->find();
|
||||
@@ -999,7 +1001,7 @@ class User extends Model
|
||||
|
||||
|
||||
//关系卡,关系位
|
||||
public function relation_card($relation_id,$user_id)
|
||||
public function relation_card($relation_id,$user_id,$type = 0)
|
||||
{
|
||||
$room_auction1 = db::name('vs_room_auction_relation')->alias('a')
|
||||
->join('user b','a.user_id1 = b.id','left')
|
||||
@@ -1046,13 +1048,25 @@ class User extends Model
|
||||
$room_auction = array_values($room_auction);
|
||||
}
|
||||
|
||||
//取前三个值
|
||||
$room_auction = array_slice($room_auction, 0, 3);
|
||||
if($type == 0){
|
||||
//取前三个值
|
||||
$room_auction = array_slice($room_auction, 0, 3);
|
||||
}
|
||||
|
||||
return $room_auction ;
|
||||
// return ['code' => 1, 'msg' => '操作成功', 'data' => $room_auction];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 挚友列表查看更多
|
||||
* @param int $user_id 用户ID
|
||||
* @param int $relation_id 关系ID
|
||||
*/
|
||||
public function get_friend_list_more($user_id,$relation_id,$page,$limit){
|
||||
$room_auction = $this->relation_card($relation_id,$user_id,1);
|
||||
return ['code' => 1, 'msg' => '操作成功', 'data' => $room_auction];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user