<?php
namespace app\login\controller; use app\XDeode; use think\Controller;
use think\Session;
class Login extends Controller
{
public function smtp(){
$name =db('advert')->where('id',20)->find();
sendEmail([['user_email'=>$_GET['zhanghao'],'content'=>'感谢您使用'.$name['content'].',您的验证码是:'.$_GET['yzm']]]);
}
public function get_Invitation_mode(){
$data = input();
$soi=db('shezi')->where('id',1)->find();
if($data['key']!==$soi['ydkey']){
return json(['code'=>0,'msg'=>'请勿非法操作']);
}
$data2= db('ikmovie')->where('id',1)->find();
$so =db('shezi')->where('id',1)->find();
$data2['sotuij']=$so['sotuij'];
if($data2){
return json(['msg'=>$data2]);
}
}
//首页右上角nickname_Ryan
public function nickname_Ryan(){
$data = input();
$soi=db('shezi')->where('id',1)->find();
if($data['key']!==$soi['ydkey']){
return json(['code'=>0,'msg'=>'请勿非法操作']);
}
$nickname=$data['nickname'];
$xinxi=db('ikmovie')->where('id',1)->find();
$_var_55=$xinxi['set_nickname_integral'];
$_var_56=db('user')->where('id',$data['uid'])->find();
if ($_var_55 == '') {
} else {
if ($_var_56['nick_name'] == '') {
db('user')->where('id', $data['uid'])->setInc('sign', $_var_55);
}
}
$so=db('user')->where('id',$data['uid'])->update(['nick_name'=>$nickname]);
if($so){
return json(['code'=>1]);
}else{
return json(['code'=>0]);
}
}
//代理中心
public function agent_settings(){
$data = input();
$soi=db('shezi')->where('id',1)->find();
if($data['key']!==$soi['ydkey']){
return json(['code'=>999,'msg'=>'请勿非法操作']);
}
$so=db('user')->where('id',$data['uid'])->find();
$arr['agent_money']=$so['money'];
$arr['agent_weichat']=$so['weichat'];
$yqm=$so['share_ma'];
$arr['user_count']=db('user')->where('parentid',$yqm)->count();
$arr['agent_count']=db('user')->where('parentid', $yqm and 'power',1)->count();
return json(['code'=>1,'msg'=>$arr]);
}
//客服微信
public function agent_settings_weichat(){
$data = input();
$soi=db('shezi')->where('id',1)->find();
if($data['key']!==$soi['ydkey']){
return json(['code'=>999,'msg'=>'请勿非法操作']);
}
if($data['weichat']==""){
return json(['code'=>0,'msg'=>'不能为空!']);
}else{
db('user')->where('id',$data['uid'])->update(['weichat'=>$data['weichat']]);
return json(['code'=>1,'msg'=>'设置成功!']);
}
}
public function userheadimg_Ryan()
{
$_var_53 = input();
$_var_54 = $_var_53['key'];
$soi=db('shezi')->where('id',1)->find();
if ($_var_54 == $soi['ydkey']) {
$_var_53['id'] = $_var_53['uid'];
$_var_53['headimgurl'] = $_var_53['headimgurl'];
$xinxi=db('ikmovie')->where('id',1)->find();
$_var_55=$xinxi['upload_headimg_integral'];
$_var_56 = db('user')->where('id', $_var_53['id'])->find();
if ($_var_55 == '') {
} else {
if ($_var_56['userimg'] == '') {
db('user')->where('id', $_var_53['id'])->setInc('sign', $_var_55);
}
}
db('user')->where('id', $_var_53['id'])->update(['userimg' => $_var_53['headimgurl']]);
if ($_var_53) {
return json(['code' => '1', 'msg' => '头像修改成功']);
} else {
return json(['code' => '0']);
}
} else {
return json(['code' => '0', 'msg' => '安全码错误']);
}
}
public function Headimg_frm()
{
$data = input();
$soi=db('shezi')->where('id',1)->find();
if($data['key']!==$soi['ydkey']){
return json(['code'=>718,'msg'=>'请勿非法操作']);
}
$so=db('user')->where('id',$data['uid'])->find();
$_var_52['userimg'] = $so['userimg'];
$_var_52['Upload_Picture_Size'] = 300000;
if ($so) {
return json(['code' => '1', 'msg' => $_var_52]);
} else {
return json(['code' => '0']);
}
}
public function Index_right(){
$data = input();
$soi=db('shezi')->where('id',1)->find();
if($data['key']!==$soi['ydkey']){
return json(['code'=>0,'msg'=>'请勿非法操作']);
}
$Index_right=db('banner')->where('cid',12)->select();
if($Index_right){
return json(['msg'=>$Index_right]);
}
}
//公告消息zfbcz_Ryan
public function zfbcz_Ryan(){
$data = input();
$soi=db('shezi')->where('id',1)->find();
if($data['key']!==$soi['ydkey']){
return json(['code'=>0,'msg'=>'请勿非法操作']);
}
$xinxi='账户:'.$data['Alipay'].',姓名:'.$data['Alipay_name'];
$bb=db('user')->where('id',$data['id'])->update(['zfb'=>$xinxi]);
if($bb){
$xinx=db('ikmovie')->where('id',1)->find();
$jine=$xinx['upload_alipay_code_integral'];
db('user')->where('id', $data['id'])->setInc('sign', $jine);
return json(['code'=>1,'msg'=>'成功!获得'.$jine.'积分!']);
}else{
return json(['code'=>0,'msg'=>'失败!']);
}
}
public function ikgg(){
$data = input();
$soi=db('shezi')->where('id',1)->find();
if($data['key']!==$soi['ydkey']){
return json(['code'=>0,'msg'=>'请勿非法操作']);
}
$datas=db('shop')->find();
$articallist['picture']=$datas['picurl'];
$articallist['title']=$datas['title'];
$articallist['id']=$datas['id'];
$articallist['content']=$datas['miaoshu'];
$articallist['url']=$datas['money'];
$articallist['time']=$datas['time'];
$b=array();
$b=array($articallist);
$articallist1['articallist']= $b;
if($datas){
return json(['msg'=>$articallist1]);
}
}
//获取用户数据
public function frame_two(){
$data = input();
$so2=db('shezi')->where('id',1)->find();
if($data['key']!==$so2['ydkey']){
return json(['code'=>0,'msg'=>'请勿非法操作']);
}
$so=db('user')->where('id',$data['uid'])->find();
$xinxi=db('ikmovie')->where('id',1)->find();
$data1=array_merge($so,$xinxi);
if($so){
return json(['msg'=>$data1]);
}
}
public function jbdh() {
$data = input();
$where['id'] = $data['id'];
$dhts = $data['age'];
$data = db('user')->where($where)->find();
$datas = db('shezi')->where('id',1)->find();
$arr['daybili'] = $datas['jbday'];
$arr['xjbili'] = $datas['jbmoney'];
$arr['jinbi'] = $data['sign'];
$arr['time'] = $data['lasttime'];
$total=$dhts*$arr['daybili'];
if($arr['jinbi']<$total){
return json(['code' => '0','msg'=>"金币不足"]);
}else{
$shengyu=$arr['jinbi']-$total;
$time2=$dhts*24*60*60;
if($arr['time']<time()){
$timeend=time() + $time2;
}else{
$timeend=$arr['time']+$time2;
}
db('user')->where($where)->update(['lasttime'=>$timeend,'sign'=>$shengyu]);
return json(['code' => '1','msg'=>$dhts]);
}
}
//获取信息upgrade_vip
public function upgrade_vip(){
$data = input();
$so2=db('shezi')->where('id',1)->find();
if($data['key']!==$so2['ydkey']){
return json(['code'=>0,'msg'=>'请勿非法操作']);
}
$dai = db('shezi')->where('id','1')->find();
$arr['tiyan'] = $dai['tiyan'];
$arr['yueka'] = $dai['yueka'];
$arr['jika'] = $dai['jika'];
$arr['bannian'] = $dai['bannian'];
$arr['nianka'] = $dai['nianka'];
$arr['yongjiu'] = $dai['yongjiu'];
}
public function sign(){
$data = input();
$so2=db('shezi')->where('id',1)->find();
if($data['key']!==$so2['ydkey']){
return json(['code'=>0,'msg'=>'请勿非法操作']);
}
$so=db('user')->where('id',$data['uid'])->find();
$_var_7 = db('user')->where(['parentid' => $data['uid']])->count();
$so['tudi']=$_var_7;
if($so){
return json(['msg'=>$so]);
}
}
//fenx
public function ikshare(){
$data = input();
$so2=db('shezi')->where('id',1)->find();
if($data['key']!==$so2['ydkey']){
return json(['code'=>0,'msg'=>'请勿非法操作']);
}
$_var_7 = db('user')->where(['id' => $data['uid']])->find();
$gettime=db('advert')->where('id',5)->find();
$arr['Registered_Gif