更新
This commit is contained in:
@@ -32,6 +32,7 @@ class Activities extends BaseCom
|
||||
$data['name'] = $activities_title??"";
|
||||
$data['gift_bag'] = [];
|
||||
foreach ($gift_bag as $k=>$v){
|
||||
$data['gift_bag'][$k]['gift_bag_id'] = $v['id']??0;
|
||||
$data['gift_bag'][$k]['name'] = $v['title']??"";
|
||||
$ext = json_decode($v['ext'],true);
|
||||
$data['gift_bag'][$k]['title1'] = $ext['title1']??"";
|
||||
@@ -49,11 +50,13 @@ class Activities extends BaseCom
|
||||
$list[$kk]['base_image'] = localpath_to_netpath("static/image/icon/gold.png");
|
||||
}elseif ($vv['type'] == 2) {
|
||||
$gift = DB::name('vs_gift')->where(['gid'=>$vv['foreign_id']])->find();
|
||||
$list[$kk]['gift_name'] = $gift['gift_name'];
|
||||
$list[$kk]['num'] = $vv['quantity'];
|
||||
$list[$kk]['gift_price'] = $gift['gift_price'];
|
||||
$list[$kk]['type'] =2;
|
||||
$list[$kk]['base_image'] = $gift['base_image'];
|
||||
if($gift){
|
||||
$list[$kk]['gift_name'] = $gift['gift_name'];
|
||||
$list[$kk]['num'] = $vv['quantity'];
|
||||
$list[$kk]['gift_price'] = $gift['gift_price'];
|
||||
$list[$kk]['type'] =2;
|
||||
$list[$kk]['base_image'] = $gift['base_image'];
|
||||
}
|
||||
} elseif ($vv['type'] == 3) {
|
||||
$decorate_price = DB::name('vs_decorate_price')->where(['id'=>$vv['foreign_id']])->find();
|
||||
if($decorate_price){
|
||||
@@ -85,8 +88,8 @@ class Activities extends BaseCom
|
||||
$uid = input('uid',$this->uid);
|
||||
$permission_status = 1;
|
||||
//查询是否首充
|
||||
$is_first_charge = db::name('vs_user_money_log')->where('user_id',$uid)->where('change_type',2)->where('money_type',1)->count();
|
||||
$permission = DB::name('vs_activities_receive')->where(['activities_id'=>$activities_id,'user_id'=>$uid])->find();
|
||||
$is_first_charge = db::name('vs_user_money_log')->where('user_id',$uid)->where('change_type',2)->where('money_type',1)->where(['createtime'=>['>=',"1760666400"]])->count();
|
||||
$permission = DB::name('vs_activities_receive')->where(['activities_id'=>$activities_id,'user_id'=>$uid])->where(['createtime'=>['>=',"1760666400"]])->find();
|
||||
$system = request()->header('system');
|
||||
$app_version = request()->header('App-Version');
|
||||
if(!$app_version){
|
||||
@@ -127,46 +130,51 @@ class Activities extends BaseCom
|
||||
//礼包
|
||||
$gift_bag = DB::name('vs_gift_bag')->where(['activities_id'=>$activities_id,'status'=>1])->find();
|
||||
$data = [];
|
||||
$data['gift_bag_id'] = $gift_bag['id']??0;
|
||||
$data['name'] = $activities['title']??"";
|
||||
$data['bag_name'] = $gift_bag['title']??"";
|
||||
$data['effective_time'] = $activities['effective_time']??"";
|
||||
//规则
|
||||
$data['rule'] = get_system_config_value('web_site')."/api/Page/page_show?id=13";
|
||||
$ext = json_decode($gift_bag['ext'],true);
|
||||
$data['money'] = $ext['money'];
|
||||
$data['counter']['counter'] = $ext['counter'];
|
||||
$data['counter']['money'] = $ext['money_str'];
|
||||
$data['counter']['diamond'] = $ext['diamond'];
|
||||
$data['money'] = $gift_bag['money'];
|
||||
$data['counter'] = $ext['counter'];
|
||||
$data['money_str'] = $ext['money_str'];
|
||||
$data['diamond'] = $ext['diamond'];
|
||||
$data['effective_time'] = $ext['activity_end_time']??"";
|
||||
if(strtotime($ext['activity_end_time']) < time()){
|
||||
return V(0,'活动已结束!',null);
|
||||
}
|
||||
$detail = DB::name('vs_gift_bag_detail')->where(['gift_bag_id'=>$gift_bag['id']])->select();
|
||||
$data['gift_list'] = [];
|
||||
foreach ($detail as $k=>$v){
|
||||
if($v['type'] == 1){
|
||||
$list[$k]['name'] = "金币";
|
||||
$list[$k]['gift_name'] = "金币";
|
||||
$list[$k]['num'] = $v['gold'];
|
||||
$list[$k]['gold'] = $v['gold'];
|
||||
$list[$k]['gift_price'] = $v['gold'];
|
||||
$list[$k]['type'] = 1;
|
||||
$list[$k]['icon'] = localpath_to_netpath("static/image/icon/gold.png");
|
||||
$list[$k]['base_image'] = localpath_to_netpath("static/image/icon/gold.png");
|
||||
}elseif($v['type'] == 2) {
|
||||
$gift = DB::name('vs_gift')->where(['gid'=>$v['foreign_id']])->find();
|
||||
$list[$k]['name'] = $gift['gift_name'];
|
||||
$list[$k]['gift_name'] = $gift['gift_name'];
|
||||
$list[$k]['num'] = $v['quantity'];
|
||||
$list[$k]['gold'] = $gift['gift_price'];
|
||||
$list[$k]['gift_price'] = $gift['gift_price'];
|
||||
$list[$k]['type'] =2;
|
||||
$list[$k]['icon'] = $gift['play_image'];
|
||||
$list[$k]['base_image'] = $gift['base_image'];
|
||||
} elseif($v['type'] == 3) {
|
||||
$decorate_price = DB::name('vs_decorate_price')->where(['id'=>$v['foreign_id']])->find();
|
||||
$gift = DB::name('vs_decorate')->where(['did'=>$decorate_price['did']])->find();
|
||||
$list[$k]['name'] = $gift['title']; //装扮名称
|
||||
$list[$k]['gift_name'] = $gift['title']; //装扮名称
|
||||
$list[$k]['num'] = $decorate_price['day']; //天数
|
||||
$list[$k]['gold'] = $decorate_price['price']; //价格
|
||||
$list[$k]['gift_price'] = $decorate_price['price']; //价格
|
||||
$list[$k]['type'] =3;
|
||||
$list[$k]['icon'] = $gift['base_image'];
|
||||
$list[$k]['base_image'] = $gift['base_image'];
|
||||
}elseif($v['type'] == 4) {
|
||||
$list[$k]['name'] = "钻石";
|
||||
$list[$k]['gift_name'] = "钻石";
|
||||
$list[$k]['num'] = $v['quantity'];
|
||||
$list[$k]['gold'] = $v['gold'];
|
||||
$list[$k]['gift_price'] = $v['gold'];
|
||||
$list[$k]['type'] = 4;
|
||||
$list[$k]['icon'] = localpath_to_netpath("static/image/icon/gold.png");
|
||||
$list[$k]['base_image'] = localpath_to_netpath("static/image/icon/gold.png");
|
||||
}
|
||||
}
|
||||
$data['gift_list'] = $list;
|
||||
@@ -177,20 +185,183 @@ class Activities extends BaseCom
|
||||
{
|
||||
$activities_id = 3;//天降好礼
|
||||
$uid = input('uid',$this->uid);
|
||||
$permission = DB::name('vs_activities_receive')->where(['activities_id'=>$activities_id,'user_id'=>$uid])->find();
|
||||
if($permission){
|
||||
return V(1,'操作成功', ['permission'=>0]);
|
||||
}else{
|
||||
return V(1,'操作成功', ['permission'=>1]);
|
||||
//礼包
|
||||
$gift_bag = DB::name('vs_gift_bag')->where(['activities_id'=>3,'status'=>1])->find();
|
||||
$permission = 0;
|
||||
if($gift_bag){
|
||||
$ext = json_decode($gift_bag['ext'],true);
|
||||
if($ext['activity_end_time'] <= time()){
|
||||
$permission = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return V(1,'操作成功', ['permission'=>$permission]);
|
||||
}
|
||||
//天降好礼发放
|
||||
public function drop_gift_send()
|
||||
{
|
||||
$uid = input('uid',$this->uid);
|
||||
$reslut = model('Activities')->drop_gift_send($uid);
|
||||
$reslut = model('Activities')->drop_gift_send($uid,16);
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//新人好礼
|
||||
public function new_charge_gift()
|
||||
{
|
||||
//活动信息
|
||||
$activities_id = 7;
|
||||
$activities_title = DB::name('vs_activities')->where(['id'=>$activities_id,'status'=>1,'delete_time'=>0])->value('title');
|
||||
//礼包
|
||||
$gift_bag = DB::name('vs_gift_bag')->where(['activities_id'=>$activities_id,'status'=>1])->select();
|
||||
$data = [];
|
||||
$data['name'] = $activities_title??"";
|
||||
$data['gift_bag'] = [];
|
||||
//一键领取
|
||||
$bag_receive_all = DB::name('vs_gift_bag_receive_log')->where(['gift_bag_id'=>17,'user_id'=>$this->uid])->find();
|
||||
foreach ($gift_bag as $k=>$v){
|
||||
$data['gift_bag'][$k]['gift_bag_id'] = $v['id']??0;
|
||||
$data['gift_bag'][$k]['name'] = $v['title']??"";
|
||||
$ext = json_decode($v['ext'],true);
|
||||
$data['gift_bag'][$k]['title1'] = $ext['title1']??"";
|
||||
$data['gift_bag'][$k]['title2'] = $ext['title2']??"";
|
||||
$data['gift_bag'][$k]['money'] = $ext['money'];
|
||||
$data['gift_bag'][$k]['gift_list'] = [];
|
||||
$detail = DB::name('vs_gift_bag_detail')->where(['gift_bag_id'=>$v['id']])->select();
|
||||
$list = [];
|
||||
foreach ($detail as $kk=>$vv){
|
||||
if($vv['type'] == 1){
|
||||
$list[$kk]['gift_name'] = "金币";
|
||||
$list[$kk]['num'] = $vv['quantity'];
|
||||
$list[$kk]['gift_price'] = $vv['gold'];
|
||||
$list[$kk]['type'] = 1;
|
||||
$list[$kk]['base_image'] = localpath_to_netpath("static/image/icon/gold.png");
|
||||
}elseif ($vv['type'] == 2) {
|
||||
$gift = DB::name('vs_gift')->where(['gid'=>$vv['foreign_id']])->find();
|
||||
if($gift){
|
||||
$list[$kk]['gift_name'] = $gift['gift_name'];
|
||||
$list[$kk]['num'] = $vv['quantity'];
|
||||
$list[$kk]['gift_price'] = $gift['gift_price'];
|
||||
$list[$kk]['type'] =2;
|
||||
$list[$kk]['base_image'] = $gift['base_image'];
|
||||
}
|
||||
} elseif ($vv['type'] == 3) {
|
||||
$decorate_price = DB::name('vs_decorate_price')->where(['id'=>$vv['foreign_id']])->find();
|
||||
if($decorate_price){
|
||||
$gift = DB::name('vs_decorate')->where(['did'=>$decorate_price['did']])->find();
|
||||
$list[$kk]['gift_name'] = $gift['title']??""; //装扮名称
|
||||
$list[$kk]['num'] = $decorate_price['day']??0; //天数
|
||||
$list[$kk]['gift_price'] = $decorate_price['price']??0; //价格
|
||||
$list[$kk]['type'] =3;
|
||||
$list[$kk]['base_image'] = $gift['base_image'] ?? "";
|
||||
}
|
||||
|
||||
}elseif ($vv['type'] == 4) {
|
||||
$list[$kk]['gift_name'] = "钻石";
|
||||
$list[$kk]['num'] = $vv['quantity'];
|
||||
$list[$kk]['gift_price'] = $vv['gold'];
|
||||
$list[$kk]['type'] = 4;
|
||||
$list[$kk]['base_image'] = localpath_to_netpath("static/image/icon/diamond.png");
|
||||
}
|
||||
}
|
||||
$data['gift_bag'][$k]['gift_list'] = array_values($list);
|
||||
if($bag_receive_all){
|
||||
$data['gift_bag'][$k]['status'] = 0;
|
||||
}else{
|
||||
if($v['id']!=17){
|
||||
$bag_receive_log = DB::name('vs_gift_bag_receive_log')->where(['gift_bag_id'=>$v['id'],'user_id'=>$this->uid])->find();
|
||||
if($bag_receive_log){
|
||||
$data['gift_bag'][$k]['status'] = 0;
|
||||
} else {
|
||||
$data['gift_bag'][$k]['status'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return V(1,'操作成功', $data);
|
||||
}
|
||||
|
||||
//新人好礼发放
|
||||
public function new_charge_gift_receive()
|
||||
{
|
||||
$uid = input('uid',$this->uid);
|
||||
$money = input('money',0);
|
||||
$reslut = model('Activities')->new_charge_gift_send($uid,$money);
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 活动权限
|
||||
*/
|
||||
public function activities_permission(){
|
||||
$system = request()->header('system');
|
||||
$app_version = request()->header('App-Version');
|
||||
if(!$app_version){
|
||||
$app_version = input('App-Version');
|
||||
}
|
||||
$api_version = 0;
|
||||
if ($system == 'iOS') {
|
||||
$api_versions = db::name('version')->where(['type' => 2, 'status' => 1])->order('id', 'desc')->find();
|
||||
$result = version_compare($api_versions['oldversion'],$app_version);
|
||||
if ($result < 0) {
|
||||
$api_version = 1;
|
||||
}
|
||||
}
|
||||
//首充
|
||||
$activities_id = 1;
|
||||
$uid = input('uid',$this->uid);
|
||||
$first_charge_permission = 1;
|
||||
//查询是否首充
|
||||
$is_first_charge = db::name('vs_user_money_log')->where('user_id',$uid)->where('change_type',2)->where('money_type',1)->where(['createtime'=>['>=',"1760666400"]])->count();
|
||||
$permission = DB::name('vs_activities_receive')->where(['activities_id'=>$activities_id,'user_id'=>$uid])->where(['createtime'=>['>=',"1760666400"]])->find();
|
||||
if($is_first_charge > 0){
|
||||
$first_charge_permission = 0;
|
||||
}
|
||||
if($permission){
|
||||
$first_charge_permission = 0;
|
||||
}
|
||||
|
||||
//天降好礼
|
||||
$gift_bag = DB::name('vs_gift_bag')->where(['activities_id'=>3,'status'=>1])->find();
|
||||
$day_drop_permission = 0;
|
||||
if($gift_bag){
|
||||
$ext = json_decode($gift_bag['ext'],true);
|
||||
if(strtotime($ext['activity_end_time']) >= time()){
|
||||
$day_drop_permission = 1;
|
||||
}
|
||||
}
|
||||
//新人充值好礼
|
||||
$activities = DB::name('vs_activities')->where(['id'=>7,'status'=>1,'delete_time'=>0])->find();
|
||||
if($activities){
|
||||
$effective_time = $activities['effective_time'];
|
||||
}else{
|
||||
$effective_time = 0;
|
||||
}
|
||||
$bag_data = DB::name('vs_gift_bag')->where(['activities_id'=>7,'status'=>1,'delete_time'=>0])->select();
|
||||
$bag_receive_log = DB::name('vs_gift_bag_receive_log')->where(['gift_bag_id'=>['in',array_column($bag_data,'id')],'user_id'=>$uid])->select();
|
||||
$new_permission = 0;
|
||||
$user_info = DB::name('user')->where(['id'=>$uid])->find();
|
||||
if($user_info['createtime']<"1760666400"){
|
||||
$user_info['createtime'] = 1760666400;
|
||||
}
|
||||
if($user_info['createtime'] + $effective_time >= time()){
|
||||
$new_permission = 1;
|
||||
}
|
||||
$gift_bag_log_ids = array_column($bag_receive_log,'gift_bag_id');
|
||||
if(in_array(17,$gift_bag_log_ids)){
|
||||
$new_permission = 0;
|
||||
}else{
|
||||
$gift_bag_log_ids = array_intersect([14,15,16],$gift_bag_log_ids);
|
||||
if(count($gift_bag_log_ids) == 3){
|
||||
$new_permission = 0;
|
||||
}
|
||||
}
|
||||
return V(1,'操作成功',[
|
||||
'first_charge_permission'=>$first_charge_permission,
|
||||
'day_drop_permission'=>$day_drop_permission,
|
||||
'n_people_permission'=>$new_permission
|
||||
],$api_version);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ use think\Controller;
|
||||
use think\Db;
|
||||
use think\Log;
|
||||
|
||||
class Ceshi extends Controller
|
||||
class Ceshi extends Controllers
|
||||
{
|
||||
//设置白名单ip访问本类接口
|
||||
protected $allowIp = [
|
||||
@@ -150,7 +150,7 @@ class Ceshi extends Controller
|
||||
//清空数据 禁用 慎用 !!!!!!
|
||||
//清空数据 禁用 慎用 !!!!!!
|
||||
//清空数据 禁用 慎用 !!!!!!
|
||||
public function clear_data()
|
||||
public function qing_chu_data()
|
||||
{
|
||||
//ip
|
||||
$ip = request()->ip();
|
||||
@@ -211,17 +211,17 @@ class Ceshi extends Controller
|
||||
|
||||
|
||||
$user = db::name('user')->where('id','>', 0)->select();
|
||||
if($user){
|
||||
foreach ($user as &$v){
|
||||
if($v['id']){
|
||||
$j = 0;
|
||||
$data[$j] = [
|
||||
'UserID' => 'u'.$v['id'],
|
||||
];
|
||||
}
|
||||
model('Tencent')->account_deletes($data);
|
||||
}
|
||||
}
|
||||
// if($user){
|
||||
// foreach ($user as &$v){
|
||||
// if($v['id']){
|
||||
// $j = 0;
|
||||
// $data[$j] = [
|
||||
// 'UserID' => 'u'.$v['id'],
|
||||
// ];
|
||||
// }
|
||||
// // model('Tencent')->account_deletes($data);
|
||||
// }
|
||||
// }
|
||||
|
||||
$reslut9 = db::name('user')->where('id','>', 0)->delete();
|
||||
if($reslut9){
|
||||
@@ -458,9 +458,9 @@ class Ceshi extends Controller
|
||||
|
||||
//删除腾讯房间
|
||||
$room = db::name('vs_room')->select();
|
||||
foreach ($room as &$value){
|
||||
model('Tencent')->delete_group('room'.$value['id']);
|
||||
}
|
||||
// foreach ($room as &$value){
|
||||
// // model('Tencent')->delete_group('room'.$value['id']);
|
||||
// }
|
||||
$reslut35 = db::name('vs_room')->where('id','>', 0)->delete();
|
||||
if($reslut35){
|
||||
$i++ ;
|
||||
@@ -772,7 +772,63 @@ class Ceshi extends Controller
|
||||
//数组末尾添加元素
|
||||
array_push($res, '财富等级日志删除失败!');
|
||||
}
|
||||
$reslut68 = db::name('vs_user_friending')->where('id','>', 0)->delete();
|
||||
if($reslut68){
|
||||
$i++ ;
|
||||
}else{
|
||||
//数组末尾添加元素
|
||||
array_push($res, '用户好友删除失败!');
|
||||
}
|
||||
$reslut69 = db::name('vs_user_friending_heart')->where('id','>', 0)->delete();
|
||||
if($reslut69){
|
||||
$i++ ;
|
||||
}else{
|
||||
//数组末尾添加元素
|
||||
array_push($res, '用户好友心跳删除失败!');
|
||||
}
|
||||
$reslut70 = db::name('vs_room_hot_value_log')->where('id','>', 0)->delete();
|
||||
if($reslut70){
|
||||
$i++ ;
|
||||
}else{
|
||||
//数组末尾添加元素
|
||||
array_push($res, '房间热度值日志删除失败!');
|
||||
}
|
||||
|
||||
$reslut71 = db::name('vs_blind_box_turntable_results_log')->where('id','>', 0)->delete();
|
||||
if($reslut71){
|
||||
$i++ ;
|
||||
}else{
|
||||
//数组末尾添加元素
|
||||
array_push($res, '盲盒转盘结果日志删除失败!');
|
||||
}
|
||||
$reslut72 = db::name('vs_blind_box_turntable_log')->where('id','>', 0)->delete();
|
||||
if($reslut72){
|
||||
$i++ ;
|
||||
}else{
|
||||
//数组末尾添加元素
|
||||
array_push($res, '盲盒转盘日志删除失败!');
|
||||
}
|
||||
$reslut73 = db::name('vs_room_pan_xlh')->where('id','>', 0)->delete();
|
||||
if($reslut73){
|
||||
$i++ ;
|
||||
}else{
|
||||
//数组末尾添加元素
|
||||
array_push($res, '房间寻乐会删除失败!');
|
||||
}
|
||||
$reslut74 = db::name('vs_room_pan_xlh_log')->where('id','>', 0)->delete();
|
||||
if($reslut74){
|
||||
$i++ ;
|
||||
}else{
|
||||
//数组末尾添加元素
|
||||
array_push($res, '房间寻乐会日志删除失败!');
|
||||
}
|
||||
$reslut75 = db::name('vs_room_pan')->where('id','>', 0)->delete();
|
||||
if($reslut75){
|
||||
$i++ ;
|
||||
}else{
|
||||
//数组末尾添加元素
|
||||
array_push($res, '房间盘删除失败!');
|
||||
}
|
||||
|
||||
//数据提交
|
||||
db::commit();
|
||||
|
||||
@@ -31,4 +31,22 @@ class Cron
|
||||
$cron = new \app\cron\controller\DaySeconds();
|
||||
$cron->index();
|
||||
}
|
||||
|
||||
//巡乐会结束 礼物发放
|
||||
public function XlhSend(){
|
||||
$cron = new \app\cron\controller\RoomPan();
|
||||
$cron->index();
|
||||
}
|
||||
|
||||
//交友房结束
|
||||
public function FriendEnd(){
|
||||
$cron = new \app\cron\controller\FriendEnd();
|
||||
$cron->index();
|
||||
}
|
||||
|
||||
//房间小时榜发礼物(每小时执行一次)
|
||||
public function RoomHourRanking(){
|
||||
$cron = new \app\cron\controller\RoomHourRanking();
|
||||
$cron->index();
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,8 @@ class Gift extends BaseCom
|
||||
public function get_gift_list()
|
||||
{
|
||||
$label = input('label',0);
|
||||
$reslut = model('Gift')->get_gift_list($label);
|
||||
$room_id = input('room_id',0);
|
||||
$reslut = model('Gift')->get_gift_list($label,$room_id);
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
}
|
||||
//聊天送礼物 (音信)
|
||||
|
||||
@@ -22,7 +22,6 @@ class Guild extends BaseCom
|
||||
public function guild_list()
|
||||
{
|
||||
$page = input('page',1);
|
||||
$page = $page > 0 ? $page : 1;
|
||||
$limit = input('limit',10);
|
||||
$search = input('search_id','');
|
||||
$reslut = model('Guild')->get_guild_list($page,$limit,$search,$this->uid);
|
||||
|
||||
@@ -20,7 +20,7 @@ class Index extends BaseCom
|
||||
$is_top = input('is_top', 0); //1非置顶2置顶
|
||||
$label_id = input('label_id', 0);
|
||||
$page = input('page', 1);
|
||||
$page_limit = input('page_limit', 15);
|
||||
$page_limit = input('page_limit', 20);
|
||||
|
||||
$reslut = model('Room')->room_list($label_id,$is_top, $page, $page_limit);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data'], $reslut['api_version']);
|
||||
@@ -29,7 +29,7 @@ class Index extends BaseCom
|
||||
//房间类型列表
|
||||
public function room_type_list()
|
||||
{
|
||||
$list = db::name('vs_room_type')->where('status', 1)->field('id,type_name as label_name')->select();
|
||||
$list = db::name('vs_room_type')->where(['status' => 1, 'deletetime' => 0])->field('id,type_name as label_name')->order('sort asc')->select();
|
||||
//给前面添加一组数据
|
||||
array_unshift($list, ['id' => -1, 'label_name' => '热门']);
|
||||
return V(1, '获取成功', $list);
|
||||
|
||||
@@ -49,6 +49,7 @@ class Invited extends BaseCom
|
||||
}
|
||||
$reslut['init_code'] = $init_code ? $init_code:'';
|
||||
$invited_draw = get_system_config_value('invited_draw');
|
||||
$reslut['invited_draw'] = $invited_draw;
|
||||
//说明
|
||||
$reslut['explain'] = '绑定成功后,您每次充值金额的'.$invited_draw.'%'.'将以钻石形式赠送给邀请人,满足提现金额邀请人可以直接提现';
|
||||
return V(1,'操作成功',$reslut);
|
||||
|
||||
@@ -26,18 +26,35 @@ class Payment extends Controller
|
||||
$user_id = input('user_id', 0);
|
||||
$money = input('money', 0);
|
||||
$coin = input('coin', 0);
|
||||
$type_params = input('type_params', 0);
|
||||
$type_id = input('type_id', 0);
|
||||
|
||||
if(!$coin){
|
||||
$coin = $money * get_system_config_value('rmb_coin_ratio');
|
||||
}
|
||||
if (!$user_id) {
|
||||
return V(0, '请选择充值用户', null);
|
||||
}
|
||||
//获取用户的手机号
|
||||
$user_phone = db::name('user')->where(["id" => $user_id])->value('mobile');
|
||||
if(!$user_phone){
|
||||
return V(0, '请先绑定手机号!', null);
|
||||
}
|
||||
//获取用户的实名信息
|
||||
$real_name = db::name('user_auth')->where(["mobile" => $user_phone,'is_real' => 1])->find();
|
||||
if(!$real_name){
|
||||
return V(0, '请先实名认证', null);
|
||||
}
|
||||
//获取用户的年龄
|
||||
if(!getAgeId($real_name['card_id'])){
|
||||
return V(0, '未成年不可充值!', null);
|
||||
}
|
||||
|
||||
if (!is_numeric($money) || floor($money) != $money || $money <= 0 || $money >= 2000) {
|
||||
if (!is_numeric($money) || floor($money) != $money || $money <= 0 || $money > 2000) {
|
||||
return V(0, '请选择正确的充值金额', null);
|
||||
}
|
||||
$user_code = db::name('user')->where(["id" => $user_id])->value('user_code');
|
||||
$title = "APP充值到用户 " . ($user_code ?? "") . " 余额!";
|
||||
$title = "APP充值到用户". ($user_code ?? "") ."余额!";
|
||||
|
||||
$order_number = $this->createOrderSn();
|
||||
$data['order_sn'] = $order_number;
|
||||
@@ -46,7 +63,9 @@ class Payment extends Controller
|
||||
$data['user_id'] = $user_id;
|
||||
$data['pay_type'] = $type;
|
||||
$data['createtime'] = time();
|
||||
$data['remarke'] = '充值到app用户'.($user_code ?? "") ."余额!";;
|
||||
$data['remarke'] = '充值到app用户'.($user_code ?? "") ."余额!";
|
||||
$data['type_params'] = $type_params;
|
||||
$data['type_id'] = $type_id;
|
||||
|
||||
$re = db::name('vs_user_recharge')->insert($data);
|
||||
if (!$re) {
|
||||
@@ -91,6 +110,7 @@ class Payment extends Controller
|
||||
$where['order_sn']=$out_trade_no;
|
||||
$where['order_type']=1;
|
||||
$where['pay_type']=2;
|
||||
$where['pay_status']=1;
|
||||
|
||||
$data=[
|
||||
'trade_no'=>$trade_no
|
||||
@@ -135,6 +155,7 @@ class Payment extends Controller
|
||||
$where['order_sn']=$out_trade_no;
|
||||
$where['order_type']=1;//1 充值
|
||||
$where['pay_type']=1;//1微信2支付宝 3通联支付宝 4通联微信
|
||||
$where['pay_status']=1;
|
||||
|
||||
$data=[
|
||||
'trade_no'=>$transaction_id
|
||||
@@ -190,6 +211,7 @@ class Payment extends Controller
|
||||
$where['order_sn']=$out_trade_no;
|
||||
$where['order_type']=1;//1 充值
|
||||
$where['pay_type']=$pay_type;//1微信2支付宝 3通联支付宝 4通联微信
|
||||
$where['pay_status']=1;
|
||||
|
||||
$data=[
|
||||
'trade_no'=>$trade_no
|
||||
@@ -211,21 +233,18 @@ class Payment extends Controller
|
||||
* 云账户回调(提现)
|
||||
*/
|
||||
public function yun_callback(){
|
||||
$data = input("data", "");
|
||||
$mess = input("mess", "");
|
||||
$timestamp = input("timestamp", "");
|
||||
$sign = input("sign", "");
|
||||
$log_data = [
|
||||
"data"=>$data,
|
||||
"mess"=>$mess,
|
||||
"timestamp"=>$timestamp,
|
||||
"sign"=>$sign
|
||||
];
|
||||
Log::record("云账户回调信息".json_encode($log_data),"info");
|
||||
// $data = input("data", "");
|
||||
// $mess = input("mess", "");
|
||||
// $timestamp = input("timestamp", "");
|
||||
// $sign = input("sign", "");
|
||||
$data = $_POST['data']??"";
|
||||
$mess = $_POST['mess']??"";
|
||||
$timestamp = $_POST['timestamp']?? "";
|
||||
$sign = $_POST['sign']??"";
|
||||
|
||||
write_log_redis("yunzhanghu_huidiao_原始数据",$_POST);
|
||||
$yun_pay = new YunPay();
|
||||
$result = $yun_pay->yun_callback($data,$mess,$timestamp,$sign);
|
||||
echo 'success';
|
||||
die;
|
||||
if($result['code']==1){
|
||||
$data = $result['data'];
|
||||
if($data){
|
||||
|
||||
@@ -149,14 +149,29 @@ class Room extends BaseCom
|
||||
//直播间送礼
|
||||
public function room_give_gift()
|
||||
{
|
||||
$key_name = "api:room:gift:" . $this->uid;
|
||||
redis_lock_exit($key_name);
|
||||
$room_id = input('room_id', 0);
|
||||
$gift_id = input('gift_id', 0);
|
||||
$gift_num = input('gift_num', 0);
|
||||
$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);
|
||||
redis_unlock($key_name);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//房间送礼 背包一键全清
|
||||
public function room_gift_all_clear()
|
||||
{
|
||||
$room_id = input('room_id', 0);
|
||||
$to_uid = input('to_uid', 0);//收礼人ID
|
||||
$heart_id = input('heart_id', 0);//交友
|
||||
$auction_id = input('auction_id');//竞拍
|
||||
$reslut = model('Room')->room_gift_all_clear($this->uid, $room_id, $to_uid,$heart_id,$auction_id);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
@@ -260,7 +275,7 @@ class Room extends BaseCom
|
||||
public function change_room_type()
|
||||
{
|
||||
$room_id = input('room_id', 0);
|
||||
$type = input('type', 1);//1-点唱,2-拍卖,3-男神,4-女神
|
||||
$type = input('type', 1);//1-点唱,2-拍卖,3-男神,4-女神,7-交友
|
||||
$reslut = model('Room')->change_room_type($this->uid, $room_id, $type);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
@@ -406,4 +421,43 @@ class Room extends BaseCom
|
||||
$reslut = model('Room')->room_online_list($room_id, $page, $limit);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//房间用户当前魅力值列表
|
||||
public function room_user_charm_list()
|
||||
{
|
||||
$room_id = input('room_id', 0);
|
||||
$user_id = input('user_id', '');
|
||||
$reslut = model('Room')->room_user_charm_list($room_id, $user_id);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
// //创建房间
|
||||
// public function create_rooms()
|
||||
// {
|
||||
// //查询所有的房间信息
|
||||
// $room = db::name('vs_room')->field('id,user_id')->where(['room_status' => ['<>',3]])->select();
|
||||
// $i = 0;
|
||||
// foreach ($room as $value) {
|
||||
// $reslut = model('Tencent')->create_group($value['user_id'],'room'.$value['id']);
|
||||
// $i++;
|
||||
// }
|
||||
// return['code' => 1, 'msg' => '成功创建了'.$i.'个房间', 'data' => null];
|
||||
// }
|
||||
|
||||
//用户重连
|
||||
public function user_reconnect()
|
||||
{
|
||||
$room_id = input('room_id', 0);
|
||||
$reslut = model('Room')->user_reconnect($this->uid, $room_id);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//用户在房间内切后台保留机制
|
||||
public function user_in_room_background()
|
||||
{
|
||||
$room_id = input('room_id', 0);
|
||||
$type = input('type', 1);//1-切后台,2-切前台
|
||||
$reslut = model('Room')->user_in_room_background($this->uid, $room_id,$type);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,8 @@ class RoomPit extends BaseCom
|
||||
//申请上麦
|
||||
public function apply_pit()
|
||||
{
|
||||
$key_name = "api:room:apply_pit:" . $this->uid;
|
||||
|
||||
$room_id = input('room_id', 0);
|
||||
$pit_number = input('pit_number', 0);
|
||||
if($room_id == 0){
|
||||
@@ -19,27 +21,19 @@ class RoomPit extends BaseCom
|
||||
if($res['code'] != 1){
|
||||
return V(0, '房间不存在', null);
|
||||
}
|
||||
//查询房间主持麦有人吗
|
||||
$room_host_info = db::name('vs_room_pit')->where(['room_id' => $room_id, 'pit_number' => 9])->value('user_id');
|
||||
//房主,管理,主持不受此限制
|
||||
$room_owner = db::name('vs_room')->where(['id' => $room_id, 'user_id' => $this->uid])->find();
|
||||
//管理
|
||||
$room_manager = db::name('vs_room_host')->where(['room_id' => $room_id, 'user_id' => $this->uid,'type' => 2,'delete_time' => null])->find();
|
||||
//主持
|
||||
$room_host = db::name('vs_room_host')->where(['room_id' => $room_id, 'user_id' => $this->uid,'type' => 1,'delete_time' => null])->find();
|
||||
if($room_host_info == 0 && !$room_owner && !$room_manager && !$room_host){
|
||||
return V(0, '上麦请联系主持', null);
|
||||
}
|
||||
|
||||
$room_label = $res['data']['label_id'];
|
||||
$room_type = $res['data']['type_id'];
|
||||
|
||||
if(($room_label == 1 && ($room_type == 1 || $room_type == 3 || $room_type == 4))|| $room_type == 2){
|
||||
redis_lock_exits($key_name);
|
||||
if(($room_label == 1 && ($room_type == 1 || $room_type == 3 || $room_type == 4 || $room_type == 8))|| $room_type == 2 || $room_type == 7){
|
||||
$reslut = model('RoomPit')->apply_pit($this->uid, $room_id,$pit_number);
|
||||
}elseif ($room_label == 2 && ($room_type == 1 || $room_type == 3 || $room_type == 4)){
|
||||
}elseif ($room_label == 2 && ($room_type == 1 || $room_type == 3 || $room_type == 4 || $room_type == 8)){
|
||||
$reslut = model('RoomSong')->apply_kpit($this->uid, $room_id,$pit_number);
|
||||
}else{
|
||||
redis_unlocks($key_name);
|
||||
return V(0, '房间不存在', null);
|
||||
}
|
||||
redis_unlocks($key_name);
|
||||
//1-禁麦位,2-清空消息,3-清空魅力值,4-加入黑名单,5-踢出房间,6-关闭麦克风,7-申请上麦,8-同意上麦,9-拒绝上麦,10-点歌,11-开启PK',
|
||||
model('Room')->room_operation_record($this->uid,$room_id,7,0,$pit_number);
|
||||
|
||||
@@ -113,9 +107,9 @@ class RoomPit extends BaseCom
|
||||
}
|
||||
$room_label = $res['data']['label_id'];
|
||||
$room_type = $res['data']['type_id'];
|
||||
if(($room_label == 1 && ($room_type == 1 || $room_type == 3 || $room_type == 4)) || $room_type == 2){
|
||||
if(($room_label == 1 && ($room_type == 1 || $room_type == 3 || $room_type == 4 || $room_type == 8)) || $room_type == 2 || $room_type == 7){
|
||||
$reslut = model('RoomPit')->DownPit($this->uid, $room_id,$pit_number);
|
||||
}elseif ($room_label == 2 && ($room_type == 1 || $room_type == 3 || $room_type == 4)){
|
||||
}elseif ($room_label == 2 && ($room_type == 1 || $room_type == 3 || $room_type == 4 || $room_type == 8)){
|
||||
$reslut = model('RoomSong')->down_kpit($this->uid, $room_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class RoomSong extends BaseCom
|
||||
public function up_song(){
|
||||
$room_song_id = input('did');
|
||||
$type = input('type');//1上移,2置顶
|
||||
$res = model('RoomSong')->up_song($room_song_id,$type);
|
||||
$res = model('RoomSong')->up_song($this->uid,$room_song_id,$type);
|
||||
return V($res['code'], $res['msg'], $res['data']);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,12 +35,16 @@ class Search extends BaseCom
|
||||
if(is_numeric($search)){
|
||||
$where = [
|
||||
'room_number' => $search,
|
||||
'apply_status' => 2
|
||||
'apply_status' => 2,
|
||||
'type_id' => ['<>',6],
|
||||
'room_status' => 1
|
||||
];
|
||||
}else{
|
||||
$where = [
|
||||
'room_name' => ['like', '%'.$search . '%'],
|
||||
'apply_status' => 2
|
||||
'apply_status' => 2,
|
||||
'type_id' => ['<>',6],
|
||||
'room_status' => 1
|
||||
];
|
||||
}
|
||||
|
||||
@@ -96,4 +100,59 @@ class Search extends BaseCom
|
||||
|
||||
return V(1, '获取成功', $lists);
|
||||
}
|
||||
|
||||
|
||||
//搜索
|
||||
public function search_list()
|
||||
{
|
||||
$search = input('search', '');
|
||||
|
||||
if(is_numeric($search)){
|
||||
$where = [
|
||||
'user_code' => $search,
|
||||
'status' => 1
|
||||
];
|
||||
$where1 = [
|
||||
'room_number' => $search,
|
||||
'apply_status' => 2,
|
||||
'type_id' => ['<>',6],
|
||||
'room_status' => 1
|
||||
];
|
||||
}else{
|
||||
$where = [
|
||||
'nickname' => ['like', '%'.$search . '%'],
|
||||
'status' => 1
|
||||
];
|
||||
$where1 = [
|
||||
'room_name' => ['like', '%'.$search . '%'],
|
||||
'apply_status' => 2,
|
||||
'type_id' => ['<>',6],
|
||||
'room_status' => 1
|
||||
];
|
||||
}
|
||||
|
||||
$users = db::name('user')->field('id as user_id,nickname,avatar,user_code,sex')->where($where)->select();
|
||||
|
||||
if(isset($users)){
|
||||
foreach ($users as &$v){
|
||||
$v['room_id'] = 0;
|
||||
//是否在房间
|
||||
$is_room = db::name('vs_room_visitor')->where(['user_id' => $v['user_id'], 'is_delete' => 1])->order('id desc')->value('room_id');
|
||||
if ($is_room) {
|
||||
$v['room_id'] = $is_room;
|
||||
}
|
||||
$v['icon'][0] = model('UserData')->user_wealth_icon($v['user_id']);//财富图标
|
||||
$v['icon'][1] = model('UserData')->user_charm_icon($v['user_id']);//魅力图标
|
||||
}
|
||||
}
|
||||
|
||||
$rooms = db::name('vs_room')->field('id as room_id,room_name,room_cover,room_number,label_id,today_hot_value')->where($where1)->select();
|
||||
if(isset($rooms)){
|
||||
foreach ($rooms as $vv){
|
||||
$vv['label_icon'] = db::name('vs_room_label')->where('id', $vv['label_id'])->value('label_icon');
|
||||
$vv['hot_value'] = $vv['today_hot_value'];
|
||||
}
|
||||
}
|
||||
return V(1, '获取成功', ['users' => $users, 'rooms' => $rooms]);
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
|
||||
class UpDataAv extends \think\Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$users = db::name('user')->field('id,nickname,avatar')->where(['status' => ['<>',0],'is_robot' => 0])->select();
|
||||
$num = count($users);
|
||||
$n = 0;
|
||||
$m = 0;
|
||||
if($users){
|
||||
foreach ($users as $user){
|
||||
if($n >= 50){
|
||||
sleep(1);
|
||||
}
|
||||
$user_id = $user['id'];
|
||||
$member_name = $user['nickname'];
|
||||
$member_face_url = $user['avatar'];
|
||||
$res = model('api/Tencent')->modify_user_infos($user_id, $member_name, $member_face_url);
|
||||
if($res['code'] == 1){
|
||||
echo '更新用户信息成功:'.$user_id.'<br>';
|
||||
$n++;
|
||||
}else{
|
||||
echo '更新用户信息失败:'.$user_id.'<br>';
|
||||
$m++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return '更新完成!总共:'.$num.'有效 用户,更新了:'.$n.'个用户信息.失败了:'.$m.'个用户信息.';
|
||||
}
|
||||
}
|
||||
@@ -234,6 +234,15 @@ class User extends BaseCom
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//关注房间(红包专用)
|
||||
public function follow_room()
|
||||
{
|
||||
$room_id = input('room_id', 0);
|
||||
$type = input('type', 1);//1-收藏,0-取消收藏
|
||||
$reslut = model('user')->follow_room($this->uid, $room_id,$type);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//用户关系卡(亲密拍)、关系位(真爱拍)
|
||||
public function user_cp_list()
|
||||
{
|
||||
|
||||
@@ -24,13 +24,21 @@ class UserGiftPack extends BaseCom
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//获取背包礼物列表总值
|
||||
public function get_gift_pack_list_count()
|
||||
{
|
||||
$user_id = $this->uid;
|
||||
$reslut = model('UserGiftPack')->get_gift_pack_list_count($user_id);
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//背包收入
|
||||
public function get_gift_pack_income()
|
||||
{
|
||||
$user_id = $this->uid;
|
||||
$page = input('page',1);
|
||||
$page_limit = input('page_limit',10);
|
||||
$reslut = model('UserGiftPack')->income_user_gift_pack($user_id,$page=1,$page_limit=10);
|
||||
$reslut = model('UserGiftPack')->income_user_gift_pack($user_id,$page,$page_limit);
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
@@ -40,7 +48,7 @@ class UserGiftPack extends BaseCom
|
||||
$user_id = $this->uid;
|
||||
$page = input('page',1);
|
||||
$page_limit = input('page_limit',10);
|
||||
$reslut = model('UserGiftPack')->get_gift_pack_outcome($user_id,$page=1,$page_limit=10);
|
||||
$reslut = model('UserGiftPack')->get_gift_pack_outcome($user_id,$page,$page_limit);
|
||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user