268 lines
8.3 KiB
PHP
268 lines
8.3 KiB
PHP
|
|
<?php
|
|||
|
|
|
|||
|
|
namespace app\api\controller;
|
|||
|
|
|
|||
|
|
|
|||
|
|
use app\common\controller\BaseCom;
|
|||
|
|
use app\common\library\Ems;
|
|||
|
|
use app\common\library\Sms;
|
|||
|
|
use fast\Random;
|
|||
|
|
use think\Config;
|
|||
|
|
use think\Validate;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 会员接口
|
|||
|
|
*/
|
|||
|
|
class User extends BaseCom
|
|||
|
|
{
|
|||
|
|
//获取用户关注列表
|
|||
|
|
public function get_user_follow_list()
|
|||
|
|
{
|
|||
|
|
$page = input('page', 1);
|
|||
|
|
$page_limit = input('page_limit', 30);
|
|||
|
|
$reslut = model('user')->get_user_follow_list($this->uid, $page, $page_limit);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//获取用户粉丝列表
|
|||
|
|
public function get_user_fans_list()
|
|||
|
|
{
|
|||
|
|
$page = input('page', 1);
|
|||
|
|
$page_limit = input('page_limit', 30);
|
|||
|
|
$reslut = model('user')->get_user_fans_list($this->uid, $page, $page_limit);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//获取用户黑名单
|
|||
|
|
public function get_blacklist(){
|
|||
|
|
$page = input('page', 1);
|
|||
|
|
$page_limit = input('page_limit', 30);
|
|||
|
|
$reslut = model('user')->get_blacklist($this->uid, $page, $page_limit);
|
|||
|
|
return V($reslut['code'],$reslut['msg'],$reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//添加用户黑名单
|
|||
|
|
public function add_blacklist(){
|
|||
|
|
$user_id = input('user_id','');
|
|||
|
|
$reslut = model('user')->add_blacklist($this->uid, $user_id);
|
|||
|
|
return V($reslut['code'],$reslut['msg'],$reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//移除用户黑名单
|
|||
|
|
public function remove_blacklist(){
|
|||
|
|
$user_id = input('uid','');
|
|||
|
|
$reslut = model('user')->remove_blacklist($this->uid,$user_id);
|
|||
|
|
return V($reslut['code'],$reslut['msg'],$reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//用户主页
|
|||
|
|
public function get_user_home()
|
|||
|
|
{
|
|||
|
|
$uid = input('user_id', 0);
|
|||
|
|
$reslut = model('user')->get_user_home($this->uid,$uid);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//用户主页动态
|
|||
|
|
public function user_home_zone()
|
|||
|
|
{
|
|||
|
|
$uid = input('user_id', 0);
|
|||
|
|
$page = input('page', 1);
|
|||
|
|
$page_limit = input('page_limit', 30);
|
|||
|
|
$reslut = model('UserZone')->get_user_zone_list($this->uid, $uid, $page, $page_limit);
|
|||
|
|
return V(1, '获取成功', $reslut);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//用户礼物墙
|
|||
|
|
public function user_gift_wall()
|
|||
|
|
{
|
|||
|
|
$uid = input('user_id', 0);
|
|||
|
|
$reslut = model('User')->get_user_gift_wall_info($uid);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//相册列表
|
|||
|
|
public function get_album_list()
|
|||
|
|
{
|
|||
|
|
$uid = input('user_id', 0);
|
|||
|
|
$reslut = model('user')->get_album_list($uid);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//相册详情
|
|||
|
|
public function get_album_detail()
|
|||
|
|
{
|
|||
|
|
$album_id = input('album_id', 0);
|
|||
|
|
$pwd = input('pwd','');
|
|||
|
|
$page = input('page', 1);
|
|||
|
|
$page_limit = input('page_limit', 30);
|
|||
|
|
$reslut = model('user')->get_album_detail($this->uid,$album_id,$pwd, $page, $page_limit);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//创建相册
|
|||
|
|
public function create_album()
|
|||
|
|
{
|
|||
|
|
$name = input('name', '');
|
|||
|
|
$pwd = input('pwd','');
|
|||
|
|
$image = input('image','');
|
|||
|
|
$reslut = model('user')->create_album($this->uid,$name,$pwd,$image);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//添加相册内容
|
|||
|
|
public function add_album_content()
|
|||
|
|
{
|
|||
|
|
$album_id = input('album_id', 0);
|
|||
|
|
$image = input('images','');
|
|||
|
|
$content = input('content','');
|
|||
|
|
$reslut = model('user')->add_album_content($this->uid,$album_id,$image,$content);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//把普通相册转为私密相册
|
|||
|
|
public function change_album_pwd()
|
|||
|
|
{
|
|||
|
|
$album_id = input('album_id', 0);
|
|||
|
|
$pwd = input('pwd','');
|
|||
|
|
$reslut = model('user')->change_album_pwd($this->uid,$album_id,$pwd);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//删除相册
|
|||
|
|
public function delete_album()
|
|||
|
|
{
|
|||
|
|
$album_id = input('album_id', 0);
|
|||
|
|
$reslut = model('user')->delete_album($this->uid,$album_id);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//移动相册
|
|||
|
|
public function move_album_images()
|
|||
|
|
{
|
|||
|
|
$id = input('id', '');
|
|||
|
|
$album_id = input('new_album_id', '');
|
|||
|
|
$reslut = model('user')->move_album_images($this->uid,$id,$album_id);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//相册点赞
|
|||
|
|
public function like_album()
|
|||
|
|
{
|
|||
|
|
$album_id = input('album_id', 0);
|
|||
|
|
$reslut = model('user')->like_album($this->uid,$album_id);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//删除相册图片
|
|||
|
|
public function delete_album_images()
|
|||
|
|
{
|
|||
|
|
$id = input('id', '');
|
|||
|
|
$reslut = model('user')->delete_album_images($this->uid,$id);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//编辑相册
|
|||
|
|
public function edit_album()
|
|||
|
|
{
|
|||
|
|
$album_id = input('album_id', 0);
|
|||
|
|
$name = input('name', '');
|
|||
|
|
$pwd = input('pwd','');
|
|||
|
|
$image = input('image','');
|
|||
|
|
$reslut = model('user')->edit_album($this->uid,$album_id,$name,$pwd,$image);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//编辑用户信息
|
|||
|
|
public function edit_user_info()
|
|||
|
|
{
|
|||
|
|
$nickname = input('nickname', '');
|
|||
|
|
$sex = input('sex', 0);
|
|||
|
|
$birthday = input('birthday', '');
|
|||
|
|
$profile = input('profile', '');
|
|||
|
|
$avatar = input('avatar', '');
|
|||
|
|
$tag_id = input('tag_id', '');//标签id,逗号分隔的字符串
|
|||
|
|
// $image = input('images', '');//背景图
|
|||
|
|
$reslut = model('user')->edit_user_info($this->uid,$nickname,$sex,$birthday,$profile,$avatar,$tag_id);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//修改用户的背景图
|
|||
|
|
public function edit_user_bg()
|
|||
|
|
{
|
|||
|
|
$image = input('images', '');
|
|||
|
|
$reslut = model('user')->edit_user_bg($this->uid,$image);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//用户标签列表
|
|||
|
|
public function get_user_tag_list()
|
|||
|
|
{
|
|||
|
|
$reslut = model('UserTag')->get_tag_list();
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//查询用户修改头像的次数
|
|||
|
|
public function get_user_avatar_num()
|
|||
|
|
{
|
|||
|
|
$reslut = model('user')->get_user_avatar_num($this->uid);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//看过我的
|
|||
|
|
public function get_look_me_list()
|
|||
|
|
{
|
|||
|
|
$page = input('page', 1);
|
|||
|
|
$page_limit = input('page_limit', 30);
|
|||
|
|
$reslut = model('user')->get_look_me_list($this->uid, $page, $page_limit);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//我的
|
|||
|
|
public function get_user_info()
|
|||
|
|
{
|
|||
|
|
$reslut = model('user')->get_me($this->uid);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//关注(回关)
|
|||
|
|
public function follow()
|
|||
|
|
{
|
|||
|
|
$uid = input('user_id', 0);
|
|||
|
|
$type = input('type', 1);//1用户,2房间
|
|||
|
|
$reslut = model('user')->follow($this->uid, $uid,$type);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//用户关系卡(亲密拍)、关系位(真爱拍)
|
|||
|
|
public function user_cp_list()
|
|||
|
|
{
|
|||
|
|
$user_id = input('user_id', 0);
|
|||
|
|
$reslut = model('UserCp')->user_cp_list($this->uid, $user_id);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//更新用户ip
|
|||
|
|
public function update_user_ip()
|
|||
|
|
{
|
|||
|
|
$ip = input('address_ip', '');
|
|||
|
|
$reslut = model('User')->update_user_ip($this->uid, $ip);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//实否可已发起私聊
|
|||
|
|
public function can_start_private_chat()
|
|||
|
|
{
|
|||
|
|
$reslut = model('User')->can_start_private_chat($this->uid);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//转币
|
|||
|
|
public function give_coin(){
|
|||
|
|
$give_uid = input('user_id', 0);
|
|||
|
|
$coin = input('coin', 0);
|
|||
|
|
$reslut = model('UserWallet')->give_coin($this->uid, $give_uid, $coin);
|
|||
|
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
|||
|
|
}
|
|||
|
|
}
|