Merge remote-tracking branch 'origin/dev' into dev

master
zhengchanglong 5 years ago
commit 0a3bdd9c3e

@ -37,7 +37,6 @@ class AutoPackController extends Think
public function package()
{
$find_web_stie = M('config')
-> field('value')
-> where(['name' => 'WEB_SITE'])
@ -49,18 +48,10 @@ class AutoPackController extends Think
}
$this->checkPackageStatus();
$this->app_package();//app渠道自动打包
$this->channel();
$this->launch_package(false);
$this->leak_detection();
}
/**
@ -209,7 +200,7 @@ class AutoPackController extends Think
$to = "./Uploads/" . $file_name . "/" . $new_name;
copy($url, ROOTTT . ltrim($to, './'));
$zip_res = $zip -> open(ROOTTT . ltrim($to, './'), \ZipArchive::CREATE);
if($zip_res == true) {
#打包数据
$pack_data = array(
@ -311,7 +302,6 @@ class AutoPackController extends Think
* @throws \think\exception\DbException
*/
private function channel() {
$zip = new \ZipArchive();
$map['status'] = 1;
@ -346,13 +336,11 @@ class AutoPackController extends Think
$launchCount = $launchModel->where(['apply_id'=>$value['id']])->count();
if($launchCount>0) {
$applyModel->where(['id' => $value['id']]) -> setField('enable_status', 3);
$launchModel->where(['apply_id'=>$value['id'], 'launch_packge'=>['in',[0,2,3]]])->save(['launch_packge'=>2,'launch_down_url'=>'','launch_plist_url'=>'']);
} else {
$applyModel -> where(['id' => $value['id']]) -> setField('enable_status', 3);
if ($value['sdk_version'] == 1) {
@ -377,7 +365,8 @@ class AutoPackController extends Think
}
$new_name = "game_package" . $value['game_id'] . "-" . $value['promote_id'] . $str_ver;
$to = "./Uploads/" . $file_name . "/" . $new_name;
copy(get_game_source_file_url($value['game_id']), ROOTTT . ltrim($to, './'));
$localPath = ROOTTT . ltrim($to, './');
copy(get_game_source_file_url($value['game_id']), $localPath);
$zip_res = $zip -> open(ROOTTT . ltrim($to, './'), \ZipArchive::CREATE);
if ($zip_res == true) {
#打包数据
@ -409,8 +398,10 @@ class AutoPackController extends Think
$updata['savename'] = $newname;
$updata['path'] = $new_to;
$this -> upload_game_pak_oss($updata);
@unlink($new_to);
if (file_exists($new_to)) {
@unlink($new_to);
}
} elseif (get_tool_status("qiniu_storage") == 1) {
$this -> dleteQiNiuFile($newname);

@ -54,6 +54,39 @@ class PlistController extends ThinkController {
}
public function create_org_plist($game_id=0,$promote_id=0,$marking="",$url=""){
$xml = new \DOMDocument();
$xml->load('./Uploads/Plist/testdemo.Plist');
$online = $xml->getElementsByTagName('dict');//查找节点
$asd=$online->item(1)->getElementsByTagName('string');//第二个节点下所有string
foreach ($asd as $key=>$value) {
switch ($value->textContent) {
case 'ipa_url':
if(preg_match("/Uploads/", $url)){
$value->nodeValue="https://".$_SERVER['HTTP_HOST'].ltrim($url,".");//"https://iosdemo.vlcms.com/app/MCHSecretary.ipa";//替换xml对应的值
}else{
$value->nodeValue=$url;
}
break;
case 'icon':
$value->nodeValue="https://".$_SERVER["HTTP_HOST"].get_cover(get_game_icon_id($game_id),'path');;
break;
case 'com.dell':
$value->nodeValue=$marking;
break;
case '1.0.0':
$value->nodeValue=game_version($game_id);
break;
case 'mchdemo':
$value->nodeValue=get_ios_game_name($game_id);
break;
}
$xml->save("./Uploads/OrgSourcePlist/$game_id.Plist");
}
return "./Uploads/OrgSourcePlist/$game_id.Plist";
}
//生成App plist文件
public function create_plist_app($version="",$app_id=0,$marking="",$url="", $promote_id=0){

@ -250,7 +250,14 @@ class UserController extends AdminController {
if($password != $repassword){
$this->error('管理员密码和确认密码不一致!');
}
$usernameUser = M('UcenterMember', 'sys_')->field('username')->where(['username' => $username])->find();
if (!empty($usernameUser)) {
$this->error('用户名已存在!');
}
$emailUser = M('UcenterMember', 'sys_')->field('username')->where(['username' => $username])->find();
if (!empty($emailUser)) {
$this->error('邮箱已存在!');
}
/* 调用注册接口注册用户 */
$User = new UserApi;
$uid = $User->register($username, $password, $email,$second_pwd);
@ -272,7 +279,7 @@ class UserController extends AdminController {
$list=D('AuthGroup')->where(array('status'=>1))->select();
$this->assign('lists',$list);
$this->meta_title = '新增管理员';
$this->m_title = '管理员列表';
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>'User/index','status'=>1])->find());

@ -41,6 +41,7 @@ class SourceEvent extends Controller
$data['remark'] = json_encode(explode('@@@', $remark));
if ($data['file_type'] == 2) {
$data['plist_url'] = "./Uploads/SourcePlist/" . $data['game_id'] . ".Plist";
$data['org_plist_url'] = "./Uploads/OrgSourcePlist/" . $data['game_id'] . ".Plist";
$plist -> create_plist($data['game_id'], 0, $data['bao_name'], $data['file_url']);
}
$res = $model -> add($data);
@ -100,6 +101,7 @@ class SourceEvent extends Controller
}
if ($data['file_type'] == 2) {
$data['plist_url'] = "./Uploads/SourcePlist/" . $data['game_id'] . ".Plist";
$data['org_plist_url'] = "./Uploads/OrgSourcePlist/" . $data['game_id'] . ".Plist";
$plist -> create_plist($data['game_id'], 0, $data['bao_name'], $data['file_url']);
}
$data['source_version'] = $game_source['source_version'] + 1;
@ -204,6 +206,7 @@ class SourceEvent extends Controller
$newFileName = $temp[count($temp)-1];
$to = $file_url;
$originalUrl = '';
if ($file_type == 1) {
$new_file_url = $real_file_url;
$zip = new \ZipArchive;
@ -213,6 +216,7 @@ class SourceEvent extends Controller
} elseif ($file_type == 2) {
if (preg_match("/.ipa/", $file_url)) {
if($flag == 0 || ($flag ==1 && $newFileName != $file_name)) {
$originalUrl = $file_url;
$new_file_url = str_replace('Uploads/SourcePack', 'Uploads/Ios/original', $real_file_url);
$to = str_replace('Uploads/SourcePack', 'Uploads/Ios/original', $file_url);
$zip_open_game_source = zip_open($real_file_url);
@ -231,7 +235,7 @@ class SourceEvent extends Controller
$res = $zip -> open($new_file_url, \ZipArchive::CREATE);
$zip -> addFromString($url_ver, json_encode($data));
$zip -> close();
unlink($real_file_url);
// unlink($real_file_url);
}
}
}
@ -256,13 +260,14 @@ class SourceEvent extends Controller
}
$model = D('Game_source');
$model->where(['game_id'=>$game_id])->save(['file_url'=>$to]);
$model->where(['game_id'=>$game_id])->save(['file_url'=>$to, 'original_url' => $originalUrl]);
$plist = A("Plist");
if ($file_type == 2) {
$data['plist_url'] = "./Uploads/SourcePlist/" . $data['game_id'] . ".Plist";
$plist -> create_plist($game_id, 0, $baoName, $to);
$plist -> create_org_plist($game_id, 0, $baoName, $originalUrl);
}
}

@ -1009,27 +1009,27 @@ function get_cover($cover_id, $field = null, $root = 1, $flag = true)
$picture = M('Picture')->where(array('status' => 1))->getById($cover_id);
if (get_tool_status("oss_storage") == 1) {
if (!empty($picture['oss_url'])) {
return $picture['oss_url'];
return str_replace('http:', 'https:', $picture['oss_url']);
} else {
return 'http://' . $_SERVER['HTTP_HOST'] . __ROOT__ . $picture['path'];
return 'https://' . $_SERVER['HTTP_HOST'] . __ROOT__ . $picture['path'];
}
} elseif (get_tool_status("qiniu_storage") == 1) {
if (!empty($picture['url'])) {
return $picture['url'];
} else {
return 'http://' . $_SERVER['HTTP_HOST'] . __ROOT__ . $picture['path'];
return '//' . $_SERVER['HTTP_HOST'] . __ROOT__ . $picture['path'];
}
} elseif (get_tool_status("cos_storage") == 1) {
if (!empty($picture['url'])) {
return $picture['url'];
} else {
return 'http://' . $_SERVER['HTTP_HOST'] . __ROOT__ . $picture['path'];
return '//' . $_SERVER['HTTP_HOST'] . __ROOT__ . $picture['path'];
}
} elseif (get_tool_status("bos_storage") == 1) {
if (!empty($picture['bos_url'])) {
return $picture['bos_url'];
} else {
return 'http://' . $_SERVER['HTTP_HOST'] . __ROOT__ . $picture['path'];
return '//' . $_SERVER['HTTP_HOST'] . __ROOT__ . $picture['path'];
}
} else {
if ($field == 'path') {

@ -519,7 +519,7 @@ class ApplyController extends BaseController
$data = M("game", "tab_")
/* 查询指定字段,不指定则查询所有字段 */
->field("tab_game.id,tab_game.game_size,tab_game.game_name,tab_game.features,tab_game.money,tab_game.sdk_version,tab_game.ratio,tab_game.icon,tab_game.game_type_name,tab_game.recommend_status,promote_id,status,tab_apply.dow_status,tab_apply.plist_url,tab_apply.id as applyid,enable_status,tab_game.sort,tab_game.relation_game_id,tab_game.relation_game_name,tab_game.material_url,dispose_time,tab_apply.promote_money as applymoney,tab_apply.promote_ratio as applyratio,apply_time,tab_apply.status as applystatus,tab_game.and_dow_address,tab_game.ios_dow_address,tab_game.add_game_address,tab_game.ios_game_address")
->field("tab_game.id,tab_game.game_size,tab_game.game_name,tab_game.features,tab_game.money,tab_game.sdk_version,tab_game.ratio,tab_game.icon,tab_game.game_type_name,tab_game.recommend_status,promote_id,status,tab_apply.dow_status,tab_apply.plist_url,tab_apply.id as applyid,tab_apply.enable_status,tab_game.sort,tab_game.relation_game_id,tab_game.relation_game_name,tab_game.material_url,dispose_time,tab_apply.promote_money as applymoney,tab_apply.promote_ratio as applyratio,apply_time,tab_apply.status as applystatus,tab_game.and_dow_address,tab_game.ios_dow_address,tab_game.add_game_address,tab_game.ios_game_address")
->join("tab_apply ON tab_game.id = tab_apply.game_id and tab_apply.promote_id = " . $promoteId)
// ->join("left join tab_game as tg ON (tab_game.id = tg.relation_game_id and tg.game_status = 1 and tab_game.id!=tab_game.relation_game_id) or (tab_game.id = tg.relation_game_id and tab_game.id!=tg.id and tg.game_status = 1) or (tab_game.id!=tab_game.relation_game_id and tab_game.relation_game_id=tg.id and tab_game.game_status=1)")
// 查询条件
@ -564,6 +564,7 @@ class ApplyController extends BaseController
$this->assign('model', $model);
$this->assign('promoteId', $promoteId);
$this->assign('thisParentPromoteId', getParentPromoteId(PID));
$this->assign('parentPromoteId', getParentPromoteId($promoteId));
$this->assign('pID', PID);
$this->assign('promoteRole', $promoteRole);
$this->assign('promoteData', getAllPromoteListByType($promoteRole));
@ -1556,4 +1557,18 @@ class ApplyController extends BaseController
$this->ajaxReturn(array("status" => 0, "msg" => "添加成功"));
}
public function getEnableStatus()
{
$applyId = I('post.apply_id');
if (empty($applyId)) {
$this->ajaxReturn(['status' => 0, 'msg' => '数据异常']);
}
$map['id'] = $applyId;
$enableStatus = M('Apply', 'tab_')->where($map)->getField('enable_status');
$this->ajaxReturn(['status' => 1, 'data' => $enableStatus]);
}
}

@ -18,6 +18,7 @@
namespace Home\Controller;
use Think\Controller;
use User\Api\MemberApi;
/**
* 前台公共控制器
@ -55,30 +56,48 @@ class HomeController extends Controller
$secret = 'd3219c70a45c5e1954be4608b288d38b';
$tokenUrl = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $appid . '&secret=' . $secret;
$result = file_get_contents($tokenUrl);
$result = json_decode($result, true);
if (!$result || isset($result['errcode'])) {
$this->ajaxReturn([
'status' => false,
'msg' => '获取失败',
]);
$content = file_get_contents(RUNTIME_PATH . 'Data/wechat_ticket');
$ticketData = null;
if ($content) {
$ticketData = json_decode($content, true);
}
$accessToken = $result['access_token'];
$ticketUrl = 'https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=' . $accessToken . '&type=jsapi';
$result = file_get_contents($ticketUrl);
$result = json_decode($result, true);
if (!$result || $result['errcode'] != 0) {
$this->ajaxReturn([
'status' => false,
'msg' => '获取失败',
]);
$isExpired = false;
$ticket = '';
if ($ticketData) {
$isExpired = time() > $ticketData['expired_at'] ? true : false;
$time = $ticketData['time'];
$ticket = $ticketData['ticket'];
}
if (!$ticketData || $isExpired) {
$ticket = $ticketData['ticket'];
$result = file_get_contents($tokenUrl);
$result = json_decode($result, true);
if (!$result || isset($result['errcode'])) {
$this->ajaxReturn([
'status' => false,
'msg' => '获取失败',
]);
}
$accessToken = $result['access_token'];
$ticketUrl = 'https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=' . $accessToken . '&type=jsapi';
$result = file_get_contents($ticketUrl);
$result = json_decode($result, true);
if (!$result || $result['errcode'] != 0) {
$this->ajaxReturn([
'status' => false,
'msg' => '获取失败',
]);
}
$ticket = $result['ticket'];
file_put_contents(RUNTIME_PATH . 'Data/wechat_ticket', json_encode(['ticket' => $ticket, 'expired_at' => time() + 3600]));
}
$ticket = $result['ticket'];
$randStr = 'aaabbbxeclsx';
$time = time();
$signStr = 'jsapi_ticket=' . $ticket . '&noncestr=' . $randStr . '&timestamp=' . $time . '&url=' . $url;
$sign = sha1($signStr);
@ -123,12 +142,18 @@ class HomeController extends Controller
{
$gameId = I('get.gid');
$promoteId = I('get.pid');
$status = I('get.status');
if (empty($gameId) || empty($promoteId)) {
$this->error('链接丢失');
}
$downLink = get_apply_dow_url($gameId, $promoteId);
if ($status == 1) {
$downLink = 'itms-services://?action=download-manifest&url=' . "https://" . $_SERVER["HTTP_HOST"] . ltrim(M('GameSource', 'tab_')->where(array('game_id' => $gameId))->getField('org_plist_url'), '.');
} else {
$downLink = get_apply_dow_url($gameId, $promoteId);
}
$this->assign('downLink', $downLink);
$this->display();
}
@ -176,4 +201,60 @@ class HomeController extends Controller
$this->assign('data', $data);
$this->display();
}
public function register()
{
$userApi = new MemberApi();
$id = $userApi->wap_register($_POST);
if ($id > 0) {
$this->add_user_play($_POST);
$this->ajaxReturn([
'status' => true,
'msg' => '注册成功'
]);
} else {
$this->ajaxReturn([
'status' => false,
'msg' => '数据有误'
]);
}
}
/**
*添加玩家信息
*/
private function add_user_play($user = array())
{
$user_play = M("UserPlay", "tab_");
$map["game_id"] = $user["game_id"];
$map["user_id"] = $user["user_id"];
$map['sdk_version'] = $user['sdk_version'];
$res = $user_play->where($map)->find();
if (empty($res)) {
$user_entity = get_user_entity($user["user_id"]);
$data["user_id"] = $user["user_id"];
$data["user_account"] = $user_entity["account"];
$data["user_nickname"] = $user_entity["nickname"];
$data["game_id"] = $user["game_id"];
$data["game_appid"] = $user["game_appid"];
$data["game_name"] = get_game_name($user["game_id"]);
$data["server_id"] = 0;
$data["server_name"] = "";
$data["role_id"] = 0;
$data['parent_id'] = $user_entity["parent_id"];
$data['parent_name'] = $user_entity["parent_name"];
$data["role_name"] = "";
$data["role_level"] = 0;
$data["bind_balance"] = 0;
$data["promote_id"] = $user_entity["promote_id"];
$data["promote_account"] = $user_entity["promote_account"];
$data['play_time'] = time();
$data['play_ip'] = get_client_ip();
$data["sdk_version"] = $user["sdk_version"];
$data['ppuid'] = $user['puid'] == '' ? 0 : $user['puid'];
$data['check_time'] = time();
$user_play->add($data);
}
}
}

@ -35,6 +35,10 @@ class PromoteController extends BaseController
//系统首页
public function index($p=1)
{
$this->meta_title = "首页";
$this->display('prepare');
exit(0);
header("Content-type:text/html;charset=utf-8");
$user = D('Promote')->isLogin();
if (empty($user)) {
@ -541,6 +545,12 @@ class PromoteController extends BaseController
$this->assign("data", $data);
$this->wxQrcode($data);
$user = D('Promote')->isLogin();
if (empty($user)) {
$this->redirect("Home/Index/index");
}
$promoteUrl = "https://m.wmtxkj.com/mobile.php?s=Ssg/login/promote_id/".$user['pid'];
$this->assign("promote_url", $promoteUrl);
$this->display();
}

@ -1731,7 +1731,7 @@ class QueryController extends BaseController
$map['game_id'] = $gameId;
}
if ($serverId != 0) {
$map['serverId'] = $serverId;
$map['server_id'] = $serverId;
}
if ($roleName != '') {
$map['role_name'] = ['like', '%' . $roleName . '%'];

@ -721,211 +721,214 @@ class UserEvent extends BaseEvent {
public function arpu_analysis() {
if (IS_POST && $_POST['time_start'] && $_POST['time_end']) {
$request = $_REQUEST;
$game_id = $request['game_id'];
$promote_id = $request['promote_id'];
$this->assign('promote_arpu',$promote_id);
$start = strtotime($request['time_start']);
$end = strtotime($request['time_end'])+24*60*60-1;
if ($start>$end) {
$start = $end;
$_REQUEST['time_start'] = $request['time_end'];
$_REQUEST['time_end'] = $request['time_start'];
$end = strtotime($request['time_start']);
}
$promote = M('promote', 'tab_')->where(['id' => session('promote_auth.pid')])->find();
$map = [
'_logic' => 'or',
'id' => $promote['id'],
'parent_id' => $promote['id'],
'grand_id' => $promote['id'],
];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
if (IS_POST && $_POST['time_start'] && $_POST['time_end']) {
$request = $_REQUEST;
$game_id = $request['game_id'];
$promote_id = $request['promote_id'];
$this->assign('promote_arpu', $promote_id);
$start = strtotime($request['time_start']);
$end = strtotime($request['time_end'])+24*60*60-1;
if ($start>$end) {
$start = $end;
$_REQUEST['time_start'] = $request['time_end'];
$_REQUEST['time_end'] = $request['time_start'];
$end = strtotime($request['time_start']);
}
} else {
$game_id = empty($request['game_id'])?0:$request['game_id'];
$promote_id = empty($request['promote_id'])?0:$request['promote_id'];
$start = mktime(0,0,0,date('m'),date('d')-6,date('Y'));
$_REQUEST['time_start'] = date('Y-m-d',$start);
$end = time();
$_REQUEST['time_end'] = date('Y-m-d');
}
} else {
$game_id = empty($request['game_id'])?0:$request['game_id'];
$promote_id = empty($request['promote_id'])?0:$request['promote_id'];
$start = mktime(0,0,0,date('m'),date('d')-6,date('Y'));
$_REQUEST['time_start'] = date('Y-m-d',$start);
$end = time();
$_REQUEST['time_end'] = date('Y-m-d');
}
//包含绑币 和 排除绑币
if (I('bind_coin') == 1){
$bangbi = true;
}else{
$bangbi = false;
}
//包含绑币 和 排除绑币
if (I('bind_coin') == 1){
$bangbi = true;
}else{
$bangbi = false;
}
if ($end-$start<=7776000 ) {
if ($end - $start <= 7776000 ) {
if ($promote_id <1) {
$pid = D('Promote')->get_child_promote(PID,'id');
if (empty($pid[0])) {
$promote_id = PID;
} else {
$id = implode(',',array_column($pid,'id'));
$promote_id = PID.','.$id;
}
$pid = D('Promote')->get_child_promote(PID,'id');
if (empty($pid[0])) {
$promote_id = PID;
} else {
$id = implode(',',array_column($pid,'id'));
$promote_id = PID.','.$id;
}
} else {
if(PID == $promote_id) {
if(PID == $promote_id) {
} else {
$pro_id1=get_prmoote_chlid_account($promote_id);
$pro_arr = array_column($pro_id1,'id');
$pro_arr[] = $promote_id;
$promote_id=implode(',',$pro_arr);
}
}
$datelist = get_date_list($start,$end);
$user = D('User');
$spend = D('Spend');
/*付费游戏数*/
$paygame = $spend->pay_game_by_time($start,$end,$game_id,$promote_id,$bangbi);
$newslist = $user->register_list_by_time($start,$end,$game_id,$promote_id,'time','');
/* 活跃玩家 */
$activelist = $user->login_count_by_time($start,$end,$game_id,$promote_id);
/* 充值金额 */
$incomelist = $spend -> money_amount_by_time($start,$end,$game_id,$promote_id,$bangbi);
/* 付费玩家 */
$paylist = $spend->pay_count_by_time($start,$end,$game_id,$promote_id,$bangbi);
/* 新付费玩家 */
$newspay = $spend->pay_count_by_time_class_game($datelist,$game_id,$promote_id,1,$bangbi);
/*新付费金额*/
$newspaysum = $spend->pay_sum_by_time_class_game($datelist,$game_id,$promote_id,1,$bangbi);
/* 开始时间前的付费玩家 */
$totalPayPlayer = $spend->payUsersStatisticsAgo($start,$game_id,$promote_id,$bangbi);
/* 留存 */
$ratention1 = $user->ratention_rate($newslist,$game_id,$promote_id);
/* 数据整理 */
foreach($datelist as $dv) {
$newPayUsers[$dv]=$activeUsers[$dv]=$newUsers[$dv]=$payUsers[$dv]=$usersIncome[$dv]=$ratentionRate1[$dv]=0;
$data[$dv]['newPayUsers']=$data[$dv]['activeUsers']=$data[$dv]['newUsers']=$data[$dv]['payUsers']=$data[$dv]['usersIncome']=0;
$data[$dv]['totalPayUsers']=intval($totalPayPlayer);
$data[$dv]['ratentionRate1']='--';
$data[$dv]['usersPayRate'] = '--';
$data[$dv]['usersArpu']=0;
$data[$dv]['usersArppu']=0;
$data[$dv]['payGame'] = 0;
} else {
$pro_id1 = get_prmoote_chlid_account($promote_id);
$pro_arr = array_column($pro_id1,'id');
$pro_arr[] = $promote_id;
$promote_id=implode(',',$pro_arr);
}
}
$datelist = get_date_list($start,$end);
$user = D('User');
$spend = D('Spend');
/*付费游戏数*/
$paygame = $spend->pay_game_by_time($start,$end,$game_id,$promote_id,$bangbi);
$newslist = $user->register_list_by_time($start,$end,$game_id,$promote_id,'time','');
/* 活跃玩家 */
$activelist = $user->login_count_by_time($start,$end,$game_id,$promote_id);
/* 充值金额 */
$incomelist = $spend -> money_amount_by_time($start,$end,$game_id,$promote_id,$bangbi);
/* 付费玩家 */
$paylist = $spend->pay_count_by_time($start,$end,$game_id,$promote_id,$bangbi);
/* 新付费玩家 */
$newspay = $spend->pay_count_by_time_class_game($datelist,$game_id,$promote_id,1,$bangbi);
/*新付费金额*/
$newspaysum = $spend->pay_sum_by_time_class_game($datelist,$game_id,$promote_id,1,$bangbi);
/* 开始时间前的付费玩家 */
$totalPayPlayer = $spend->payUsersStatisticsAgo($start,$game_id,$promote_id,$bangbi);
/* 留存 */
$ratention1 = $user->ratention_rate($newslist,$game_id,$promote_id);
/* 数据整理 */
foreach($datelist as $dv) {
$newPayUsers[$dv]=$activeUsers[$dv]=$newUsers[$dv]=$payUsers[$dv]=$usersIncome[$dv]=$ratentionRate1[$dv]=0;
$data[$dv]['newPayUsers']=$data[$dv]['activeUsers']=$data[$dv]['newUsers']=$data[$dv]['payUsers']=$data[$dv]['usersIncome']=0;
$data[$dv]['totalPayUsers']=intval($totalPayPlayer);
$data[$dv]['ratentionRate1']='--';
$data[$dv]['usersPayRate'] = '--';
$data[$dv]['usersArpu']=0;
$data[$dv]['usersArppu']=0;
$data[$dv]['payGame'] = 0;
}
foreach($datelist as $dv) {
/**
* 付费游戏数
*/
foreach ($paygame as $pgal) {
if($dv == $pgal['pay_time']) {
$paygame[$dv]=intval($pgal['pay_num']);
$data[$dv]['payGame']=intval($pgal['pay_num']);break;
}
}
foreach($datelist as $dv) {
/**
* 付费游戏数
*/
foreach ($paygame as $pgal) {
if($dv == $pgal['pay_time']) {
$paygame[$dv]=intval($pgal['pay_num']);
$data[$dv]['payGame']=intval($pgal['pay_num']);break;
}
}
/* 新增玩家 */
foreach ($newslist as $nlv) {
if ($dv == $nlv['time']) {
/* 新增玩家 */
foreach ($newslist as $nlv) {
if ($dv == $nlv['time']) {
$data[$dv]['newUsers']=count(explode(',',$nlv['id']));break;
}
}
/* 活跃玩家 */
foreach ($activelist as $alv) {
if ($dv == $alv['time']) {
$activeUsers[$dv]=intval($alv['login_num']);
$data[$dv]['newUsers']=count(explode(',',$nlv['id']));break;
}
}
/* 活跃玩家 */
foreach ($activelist as $alv) {
if ($dv == $alv['time']) {
$activeUsers[$dv]=intval($alv['login_num']);
$data[$dv]['activeUsers']=intval($alv['login_num']);break;
}
}
$data[$dv]['activeUsers']=intval($alv['login_num']);break;
}
}
/* 充值金额 */
foreach ($incomelist as $ilv) {
if($ilv['pay_time']==$dv) {
$usersIncome[$dv] = round($ilv['money_amount'],2);
$data[$dv]['usersIncome'] = round($ilv['money_amount'],2);
break;
}
}
/* 付费玩家 */
foreach ($paylist as $plv) {
if ($plv['pay_time']==$dv) {
$payUsers[$dv]=intval($plv['pay_num']);
/* 充值金额 */
foreach ($incomelist as $ilv) {
if($ilv['pay_time']==$dv) {
$usersIncome[$dv] = round($ilv['money_amount'],2);
$data[$dv]['usersIncome'] = round($ilv['money_amount'],2);
break;
}
}
/* 付费玩家 */
foreach ($paylist as $plv) {
if ($plv['pay_time']==$dv) {
$payUsers[$dv]=intval($plv['pay_num']);
$data[$dv]['payUsers']=intval($plv['pay_num']);break;
}
}
/* 1日留存 */
foreach ($ratention1 as $r1) {
if ($r1['play_time'] == $dv) {
$rate = str_replace('.00','',$r1['retention_rate1']);
$data[$dv]['ratentionRate1']=$rate.'%';break;
}
}
/* 新付费玩家 */
foreach ($newspay as $npv) {
if ($npv['pay_time'] == $dv) {
$totalPayPlayer = $totalPayPlayer+intval($npv['pay_num']);
$data[$dv]['payUsers']=intval($plv['pay_num']);break;
}
}
/* 1日留存 */
foreach ($ratention1 as $r1) {
if ($r1['play_time'] == $dv) {
$rate = str_replace('.00','',$r1['retention_rate1']);
$data[$dv]['ratentionRate1']=$rate.'%';break;
}
}
/* 新付费玩家 */
foreach ($newspay as $npv) {
if ($npv['pay_time'] == $dv) {
$totalPayPlayer = $totalPayPlayer+intval($npv['pay_num']);
$data[$dv]['newPayUsers']=intval($npv['pay_num']);
$data[$dv]['totalPayUsers']=intval($totalPayPlayer);
break;
} else {
$data[$dv]['newPayUsers']=intval($npv['pay_num']);
$data[$dv]['totalPayUsers']=intval($totalPayPlayer);
break;
} else {
$data[$dv]['totalPayUsers']=intval($totalPayPlayer);
}
}
/*新付费金额*/
foreach ($newspaysum as $nspv) {
if ($nspv['pay_time'] == $dv) {
$data[$dv]['newPaySum']=round($nspv['pay_sum'],2);
break;
}
}
}
foreach ($activeUsers as $k1=>$ap) {
/* 付费率=付费玩家/活跃玩家 */
foreach ($payUsers as $k2 => $pp) {
if ($k1 === $k2 && $ap>0 && $pp>0) {
$payrate = sprintf("%.2f",$pp/$ap*100);
$data[$k1]['usersPayRate']=str_replace('.00','',$payrate).'%';
break;
} elseif ($k1 === $k2) {
}
$data[$dv]['totalPayUsers']=intval($totalPayPlayer);
}
}
/*新付费金额*/
foreach ($newspaysum as $nspv) {
if ($nspv['pay_time'] == $dv) {
$data[$dv]['newPaySum']=round($nspv['pay_sum'],2);
break;
}
}
}
/* ARPU=当日总充值数/活跃玩家数 */
foreach ($usersIncome as $k2 => $ns) {
if ($k1 === $k2 && $ap>0 && $ns>0) {
$data[$k1]['usersArpu']=$ns/$ap;//str_replace('.00','',$ui);
break;
} elseif ($k1 === $k2) {
}
foreach ($activeUsers as $k1=>$ap) {
/* 付费率=付费玩家/活跃玩家 */
foreach ($payUsers as $k2 => $pp) {
if ($k1 === $k2 && $ap>0 && $pp>0) {
$payrate = sprintf("%.2f",$pp/$ap*100);
$data[$k1]['usersPayRate']=str_replace('.00','',$payrate).'%';
break;
} elseif ($k1 === $k2) {
}
}
/* ARPU=当日总充值数/活跃玩家数 */
foreach ($usersIncome as $k2 => $ns) {
if ($k1 === $k2 && $ap>0 && $ns>0) {
$data[$k1]['usersArpu']=$ns/$ap;//str_replace('.00','',$ui);
break;
} elseif ($k1 === $k2) {
}
}
}
}
foreach ($usersIncome as $k1 => $ns) {
/* ARPPU=当日总充值/付费玩家数 */
foreach ($payUsers as $k2 => $pp) {
if ($k1 === $k2 && $pp>0 && $ns>0) {
$data[$k1]['usersArppu']=$ns/$pp;//sprintf("%d",$ns/$pp);
break;
} elseif ($k1 === $k2) {
}
}
}
} else {
$this->assign('timeout',1);
}
foreach ($usersIncome as $k1 => $ns) {
/* ARPPU=当日总充值/付费玩家数 */
foreach ($payUsers as $k2 => $pp) {
if ($k1 === $k2 && $pp>0 && $ns>0) {
$data[$k1]['usersArppu']=$ns/$pp;//sprintf("%d",$ns/$pp);
break;
} elseif ($k1 === $k2) {
}
}
}
//file_put_contents(dirname(__FILE__) . '/../Controller/arpu'.PID.'.txt',json_encode($data));
} else {
$this->assign('timeout',1);
}
$this->assign('list_data',$data);
//file_put_contents(dirname(__FILE__) . '/../Controller/arpu'.PID.'.txt',json_encode($data));
$this->display();
$this->assign('list_data',$data);
$this->display();
}

@ -235,20 +235,31 @@
<span>游戏类型:<span>{$vo.game_type_name}</span>&nbsp;&nbsp;</span>
</p>
</div>
<?php
$qrcode = get_cover($vo['icon'],'path');
if (stripos($qrcode,'http') === false) {$qrcode = C('APPLY_DOWN_DOMAIN');}
$qrcode = base64_encode(base64_encode(get_cover($vo['icon'],'path')));
if (stripos($qrcode,'http') === false) {
if (stripos($qrcode,'.com') === false) {
$qrcode = 'http://'.C('APPLY_DOWN_DOMAIN').$qrcode;
} else {
$qrcode = 'http://'.$qrcode;
}
}
$qrcodes = $qrcode;
$qrcode = base64_encode(base64_encode($qrcode));
?>
<div class="game-operating" style="width: 35%;">
<div class="game-operating" data-url="{$qrcodes}" style="width: 35%;">
<if condition="$promoteRole == 1">
<span class="add-game" game-id="{$vo.id}" promote-type="2" style="cursor: pointer;margin-right: 10px;"><u>添加组长游戏</u></span>
<if condition="$parentPromoteId == 0">
<span class="add-game" game-id="{$vo.id}" promote-type="2" style="cursor: pointer;margin-right: 10px;"><u>添加组长游戏</u></span>
</if>
<span class="add-game" game-id="{$vo.id}" promote-type="3" style="cursor: pointer;margin-right: 10px;"><u>添加推广员游戏</u></span>
</if>
<?php $downloadUrl = get_apply_dow_url($vo['id'],$vo['promote_id']);?>
<span class="game-link" data-qrcode="{:U('Apply/qrcode',['url'=>base64_encode(base64_encode($downloadUrl)),'logo'=>$qrcode])}" data-url="{$downloadUrl}" style="cursor: pointer;margin-right: 10px;"><u>复制下载链接</u></span>
<span class="game-link" data-qrcode="{:U('Apply/qrcode',['url'=>base64_encode(base64_encode($downloadUrl)),'logo'=>$qrcode])}" data-url="{$downloadUrl}" data-apply-id="{$vo.applyid}" style="cursor: pointer;margin-right: 10px;"><u>复制下载链接</u></span>
<?php $flooringPageUrl = 'http://'.C('APPLY_DOWN_DOMAIN').U('Home/promitionofregestion',array('gid'=>$vo['id'],'pid'=>$vo['promote_id']));?>
<span class="game-link" data-qrcode="{:U('Apply/qrcode',['url'=>base64_encode(base64_encode($flooringPageUrl)),'logo'=>$qrcode])}" data-url="{$flooringPageUrl}" style="cursor: pointer;margin-right: 10px;"><u>落地页链接</u></span>
<span class="game-link" data-qrcode="{:U('Apply/qrcode',['url'=>base64_encode(base64_encode($flooringPageUrl)),'logo'=>$qrcode])}" data-url="{$flooringPageUrl}" data-apply-id="{$vo.applyid}" style="cursor: pointer;margin-right: 10px;"><u>落地页链接</u></span>
<span class="down-game-btn" data-id="{$vo.id}" style="cursor: pointer;margin-right: 10px;color: #999"><u>下架</u></span>
</div>
</div>
@ -963,35 +974,58 @@
$('.game-link').on('click', function () {
var url = $(this).attr('data-url');
var qrcode = $(this).attr('data-qrcode');
var applyId = parseInt($(this).attr('data-apply-id'));
// $.ajax({
// type: "post",
// url: "__URL__/qrcodeNew",
// dataType: "json",
// data: {'url':url},
// success: function (data) {
// console.log(data);
// },
// error: function (result) {
// layer.msg('网络异常', {icon: 5});
// }
// });
// $.get("__URL__/qrcodeNew/url/" + url,function(data,status){
// console.log(data);
// qrcode = data;
// });
// $('#download_copy').attr('data-url',url);
$('#game_link_ercode').attr('src',qrcode);
$('#game_link_address').text(url);
$('#game_link_address_copy').text(url);
$('#game_link').show();
$('.game-window-bg').show();
$.ajax({
type: "post",
url: "__URL__/getEnableStatus",
dataType: "json",
data: {'apply_id': applyId},
success: function (data) {
console.log(data);
if (data.status == 0) {
layer.msg(data.msg, {icon: 5});
return false;
}
var e = document.getElementById("game_link_address_copy");
e.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令
var enableStatus = parseInt(data.data);
if (enableStatus == 1) {
// $('#download_copy').attr('data-url',url);
$('#game_link_ercode').attr('src',qrcode);
$('#game_link_address').text(url);
$('#game_link_address_copy').text(url);
$('#game_link').show();
$('.game-window-bg').show();
var e = document.getElementById("game_link_address_copy");
e.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令
} else {
var iconIndex = 7;
var enableStatusName = '';
switch (enableStatus) {
case 0:
enableStatusName = '未打包';
break;
case 2:
case 3:
enableStatusName = '打包中';
break;
case -1:
iconIndex = 5;
enableStatusName = '打包失败';
break;
}
layer.alert(enableStatusName, {icon: iconIndex});
return false;
}
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
});
// $("#download_copy").zclip({

@ -2,7 +2,19 @@
<html lang="en">
<head>
<meta itemprop="name" content="{$data[0]['relation_game_name']}"/>
<meta itemprop="image" content="https://{$_SERVER['HTTP_HOST']}{$data[0]['icon']|get_cover='path'}"/>
<?php
$icon = get_cover($data[0]['icon'],'path');
if (stripos($icon,'http') === false) {
if (stripos($icon,'.com') === false) {
$icon = 'http://'.C('APPLY_DOWN_DOMAIN').$icon;
} else {
$icon = 'http://'.$icon;
}
}
?>
<meta itemprop="image" content="{:get_cover($data[0]['icon'],'path')}"/>
<meta name="description" itemprop="description"
content="{$data[0]['features']}"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
@ -52,15 +64,89 @@
margin-top: 21px;
width: 100%;
}
.register-box-max {
width: 80%;
height: 40%;
top: 30%;
left: 10%;
position: fixed;
z-index: 10;
background-color: #fff;
border-radius: 10px;
}
.register-bg {
width: 100%;
height: inherit;
position: fixed;
background-color: #0a0a0a;
opacity: 0.5;
}
.register-title-box {
padding: 10px 10px;
margin-top: 10px;
text-align: center;
font-size: 1.2rem;
}
.register-title-box span {
font-weight: 600;
}
.register-input-box {
text-align: center;
font-size: 1rem;
}
.register-input-box input {
width: calc(80% - 5px);
height: 2rem;
padding-left: 5px;
margin-top: 10px;
margin-bottom: 10px;
border: 1px solid #6f6f6f;
border-radius: 3px;
}
.register-btn-box {
margin-top: 40px;
text-align: center;
}
.register-btn-box button {
width: 80%;
height: 2.5rem;
border: 0;
border-radius: 5px;
background-color: #1993ff;
color: #fff;
font-size: 1.1rem;
}
</style>
</head>
<body class="main_bg">
<input type="hidden" name="title" value="{$data[0]['relation_game_name']}">
<input type="hidden" name="icon" value="{$data[0]['icon']|get_cover='path'}">
<input type="hidden" name="icon" value="{:get_cover($data[0]['icon'],'path')}">
<input type="hidden" name="desc" value="{$data[0]['features']}">
<div class="bn-rule" style="display: none;"><img id="rule-img" src=""></div>
<!--<div class="register-box-max">-->
<!-- <div class="register-title-box">-->
<!-- <span>注册</span>-->
<!-- </div>-->
<!-- <div class="register-input-box">-->
<!-- <input value="" placeholder="账号">-->
<!-- <input value="" placeholder="密码">-->
<!-- </div>-->
<!-- <div class="register-btn-box">-->
<!-- <button>注册</button>-->
<!-- </div>-->
<!--</div>-->
<!--<div class="register-bg"></div>-->
<div class="h_wrap">
<notempty name="data[0]['flooring_page_imgs']">
<div id="data-1" style="display: none;">
@ -104,7 +190,6 @@
</div>
</notempty>
<div class="h_title_box ta_c p_t_15">
<script src="__STATIC__/layer/layer.js"></script>
<script src="__STATIC__/ios9/js/layer/layer.js?VerNo=20190923" type="text/javascript"></script>
@ -124,6 +209,18 @@
}
} else {
if (is_ios()) {
if (Boolean(navigator.userAgent.match(/OS [1][3]_[1][_\d]* like Mac OS X/i))) {
if (parseInt("{:I('get.status')}") > 0) {
location.href = "{:U('iosDown',array('gid'=>$gameId,'pid'=>I('get.pid'),'status'=>1))}";
return false;
} else {
layer.confirm('请先到官网注册',{title:''} , function () {
location.href = "/mobile.php?s=/User/login/pid/" + "{:I('get.pid')}" + "/gid/" + "{:I('get.gid')}" + ".html";
});
return false;
}
}
location.href = "{:U('iosDown',array('gid'=>$gameId,'pid'=>I('get.pid')))}";
} else {
var downLink = $(this).attr('down-link');
@ -152,7 +249,8 @@
})
var title = $('[name=title]').val();
var description = $('[name=desc]').val();
var icon = window.location.protocol + "//" + window.location.host + $('[name=icon]').val();
// var icon = window.location.protocol + "//" + window.location.host + $('[name=icon]').val();
var icon = $('[name=icon]').val();
wxReady(title, description, icon)
}
}

@ -82,6 +82,15 @@
<span id="email_tip"></span>
</td>
</tr>
<tr>
<td class="l"><span class="req">*</span>超级签链接:</td>
<td class="r" style="position: relative;">
<span><a href="{$promote_url}" target="_blank">{$promote_url}</a></span>
<span id="email_tip"></span>
</td>
</tr>
<!-- <tr>-->
<!-- <td class="l"><span class="req">*</span>支付宝账号:</td>-->
<!-- <td class="r">-->

@ -5,37 +5,37 @@
<block name="body">
<div class="page-overview promote-index-overview index-overview clearfix poll">
<ul>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div><div class="text text2"><p>推广总用户</p><span>{$user_count}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div><div class="text text1"><p>推广总充值</p><span>¥{$total_money}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div><div class="text text3"><p>当日新增用户充值</p><span>¥{$today_add_user_money}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div><div class="text text5"><p>当月新增用户充值</p><span>¥{$month_add_user_money}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div><!-- <div class="text text2"><p>推广总用户</p><span>{$user_count}</span></div> --></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div><!-- <div class="text text1"><p>推广总充值</p><span>¥{$total_money}</span></div> --></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div><!-- <div class="text text3"><p>当日新增用户充值</p><span>¥{$today_add_user_money}</span></div> --></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div><!-- <div class="text text5"><p>当月新增用户充值</p><span>¥{$month_add_user_money}</span></div> --></li>
</ul>
<ul style="margin-top: 10px">
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div><div class="text text2"><p>昨日注册用户</p><span>{$yesterday_user_regist_count}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div><div class="text text1"><p>昨日充值金额</p><span>¥{$yesterday_total_money}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div><div class="text text3"><p>今日注册用户</p><span>{$yesterday_regist_user_count}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div><div class="text text5"><p>今日充值金额</p><span>¥{$yesterday_total_money}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div><!-- <div class="text text2"><p>昨日注册用户</p><span>{$yesterday_user_regist_count}</span></div> --></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div><!-- <div class="text text1"><p>昨日充值金额</p><span>¥{$yesterday_total_money}</span></div> --></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div><!-- <div class="text text3"><p>今日注册用户</p><span>{$yesterday_regist_user_count}</span></div> --></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div><!-- <div class="text text5"><p>今日充值金额</p><span>¥{$yesterday_total_money}</span></div> --></li>
</ul>
</div>
<div class="index-tab-list">
<ul>
<li>
<div class="qcl-box">
<div class="qcl-box-hand"><span class="qcl-tit">快捷菜单</span><span class="more"><a href="{:U('quick_menu_list')}">自定义></a></span></div>
<div class="qcl-box-hand"><span class="qcl-tit">快捷菜单</span><span class="more"><!--<a href="{:U('quick_menu_list')}">自定义></a>--></span></div>
<div class="qcl-bnt">
<empty name="menu_list">
暂无数据
<else/>
<ul>
<!-- <ul>
<volist name="menu_list" id="menu">
<li>
<a href="{$menu.url}">
<a href="{/*$menu.url*/}">
<span><img src="https://fileuc.37376.com/180912-80cfe5b6e68941f4bfe4cd697765abb4.png"></span>
<span>{$menu.name}</span>
<span>{/*$menu.name*/}</span>
</a>
</li>
</volist>
</ul>
</ul> -->
</empty>
</div>
</div>

@ -93,12 +93,13 @@
<?php else:?>
<a href="javascript:;" style="color: red;" class="cancel-shift-btn editbtn">取消换组</a>
<?php endif;?>
<?php endif;?>
<?php if(in_array($vo['id'], $hasPlayerList)):?>
<?php if(!in_array($vo['id'], $hasShiftPlayerList)):?>
<a href="javascript:;" class="shift-player-btn editbtn">玩家迁移</a>
<?php else:?>
<a href="javascript:;" style="color: red;" class="cancel-shift-player-btn editbtn">取消玩家迁移</a>
<?php if(in_array($vo['id'], $hasPlayerList)):?>
<?php if(!in_array($vo['id'], $hasShiftPlayerList)):?>
<a href="javascript:;" class="shift-player-btn editbtn">玩家迁移</a>
<?php else:?>
<a href="javascript:;" style="color: red;" class="cancel-shift-player-btn editbtn">取消玩家迁移</a>
<?php endif;?>
<?php endif;?>
<?php endif;?>
</td>

@ -0,0 +1,10 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/index/index.new.css" rel="stylesheet" >
</block>
<block name="body">
<div class="page-overview promote-index-overview index-overview clearfix poll">
<div>首页优化中,暂未开放!</div>
</div>
</block>

@ -47,16 +47,17 @@
<a href="{:U('Promote/mygrand')}" class="<if condition='CONTROLLER_NAME eq Promote and (ACTION_NAME eq mygrand or ACTION_NAME eq add_chlid or ACTION_NAME eq edit_chlid) '>active</if> ">推广员管理</a>
</if>
</div>
<!-- <div class="subNav jssubNav"><i class="prev_icon icon_shujvi"></i><span>数据管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('Query/summary')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq summary '>active</if> ">数据汇总</a>
<a href="{:U('Query/recharge')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq recharge '>active</if> ">充值明细</a>
<a href="{:U('Query/register')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq register '>active</if> ">注册明细</a>
<a href="{:U('Query/arpu_analysis')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq arpu_analysis '>active</if> ">ARPU统计</a>
<a href="{:U('Query/retention_analysis')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq retention_analysis '>active</if> ">留存统计</a>
<a href="{:U('Query/userRoles')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRoles '>active</if> ">角色查询</a>
<a href="{:U('Query/userRecharges')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRecharges '>active</if> ">充值玩家</a>
</div> -->
<!-- <div class="subNav jssubNav"><i class="prev_icon icon_shujvi"></i><span>数据管理</span><i class="arrow_icon"></i></div>-->
<!-- <div class="navContent jsnavContent">-->
<!-- <a href="{:U('Query/dailySummary')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq dailySummary '>active</if> ">每日概况</a>-->
<!-- <a href="{:U('Query/summary')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq summary '>active</if> ">数据汇总</a>-->
<!-- <a href="{:U('Query/recharge')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq recharge or ACTION_NAME eq viewSpendDetailed) '>active</if> ">充值明细</a>-->
<!-- <a href="{:U('Query/register')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq register or ACTION_NAME eq viewRole) '>active</if> ">注册明细</a>-->
<!-- <a href="{:U('Query/arpu_analysis')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq arpu_analysis '>active</if> ">ARPU统计</a>-->
<!-- <a href="{:U('Query/retention_analysis')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq retention_analysis '>active</if> ">留存统计</a>-->
<!-- <a href="{:U('Query/userRoles')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRoles '>active</if> ">角色查询</a>-->
<!-- <a href="{:U('Query/userRecharges')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRecharges '>active</if> ">充值玩家</a>-->
<!-- </div>-->
<!-- <div class="subNav jssubNav"><i class="prev_icon icon_caiwu"></i><span>财务管理</span><i class="arrow_icon"></i></div> -->
<!-- <div class="navContent jsnavContent"> -->
@ -82,14 +83,16 @@
</eq> -->
<!--<div class="subNav jssubNav"><i class="prev_icon icon_fuli"></i><span>会长福利</span><i class="arrow_icon"></i></div>-->
<div class="subNav jssubNav"><i class="prev_icon icon_fuli"></i><span>平台币管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('PromoteCoin/myCoin')}" class="<if condition='CONTROLLER_NAME eq PromoteCoin and (ACTION_NAME eq myCoin or ACTION_NAME eq coinRecord or ACTION_NAME eq coinRecordDesc) '>active</if> ">我的平台币</a>
<a href="{:U('PromoteCoin/record')}" class="<if condition='CONTROLLER_NAME eq PromoteCoin and (ACTION_NAME eq shift or ACTION_NAME eq record) '>active</if> ">平台币转移</a>
<if condition="($parent_id eq 0) and ($grand_id eq 0)">
<a href="{:U('CoinOrder/order_list')}" class="<if condition='CONTROLLER_NAME eq CoinOrder and (ACTION_NAME eq order_list or ACTION_NAME eq order_add or ACTION_NAME eq order_detail) '>active</if> ">平台币充值</a>
</if>
</div>
<if condition="get_promote_levels(session('promote_auth.pid')) neq '三级推广员'">
<div class="subNav jssubNav"><i class="prev_icon icon_fuli"></i><span>平台币管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('PromoteCoin/myCoin')}" class="<if condition='CONTROLLER_NAME eq PromoteCoin and (ACTION_NAME eq myCoin or ACTION_NAME eq coinRecord or ACTION_NAME eq coinRecordDesc) '>active</if> ">我的平台币</a>
<a href="{:U('PromoteCoin/record')}" class="<if condition='CONTROLLER_NAME eq PromoteCoin and (ACTION_NAME eq shift or ACTION_NAME eq record) '>active</if> ">平台币转移</a>
<if condition="($parent_id eq 0) and ($grand_id eq 0)">
<a href="{:U('CoinOrder/order_list')}" class="<if condition='CONTROLLER_NAME eq CoinOrder and (ACTION_NAME eq order_list or ACTION_NAME eq order_add or ACTION_NAME eq order_detail) '>active</if> ">平台币充值</a>
</if>
</div>
</if>
<!--<div class="subNav jssubNav"><i class="prev_icon icon_zhandian"></i><span>联盟站点</span><i class="arrow_icon"></i></div>-->
<!--<div class="navContent jsnavContent">-->
<!--<a href="{:U('SiteApply/index')}" class="<if condition='CONTROLLER_NAME eq SiteApply and ACTION_NAME eq index '>active</if> ">站点申请</a>-->

@ -112,15 +112,15 @@
</div>
<div class="form-group normal_space fr">
<label class="form-title select-title">推广员账号:</label>
<select id="promote_id" name="promote_id" class="reselect select_gallery" style="min-width:170px;">
<option game-id="0" value="0">推广员账号</option>
<option game-id="{:session('promote_auth.pid')}" value="{:session('promote_auth.pid')}">自己</option>
<volist name=":get_promote_chlid_account(PID)" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.account}</option>
</volist>
</select>
<input type="hidden" id="promote_account" name="promote_account" value='{:I("promote_account")}'>
<label class="form-title select-title">推广员账号:</label>
<select id="promote_id" name="promote_id" class="reselect select_gallery" style="min-width:170px;">
<option game-id="0" value="0">推广员账号</option>
<option game-id="{:session('promote_auth.pid')}" value="{:session('promote_auth.pid')}">自己</option>
<volist name=":get_promote_chlid_account(PID)" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.account}</option>
</volist>
</select>
<input type="hidden" id="promote_account" name="promote_account" value='{:I("promote_account")}'>
</div>
<div class="form-group normal_space fr">
<label class="form-title select-title">游戏名称:</label>

@ -28,7 +28,7 @@
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') === $game['id']">selected</if>>{$game.game_name}</option>
<option value="{$game.game_id}" <if condition="I('game_id') === $game['game_id']">selected</if>>{$game.game_name}</option>
</volist>
</select>
</div>
@ -47,22 +47,22 @@
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<if condition="$grand_id eq 0">
<if condition="$parent_id eq 0">
<div class="form-group normal_space">
<select id="group-select" name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广员</option>
<volist name="promotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}">{$promote.account}</option>
<select id="group-select" name="headman_promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择组长</option>
<volist name="groupPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('headman_promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>
</if>
<if condition="$parent_id eq 0">
<if condition="$grand_id eq 0">
<div class="form-group normal_space">
<select id="promote-select" name="headman_promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择组长</option>
<volist name="groupPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}">{$promote.account}</option>
<select id="promote-select" name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广员</option>
<volist name="promotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>

@ -28,7 +28,7 @@
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') === $game['id']">selected</if>>{$game.game_name}</option>
<option value="{$game.game_id}" <if condition="I('game_id') eq $game['game_id']">selected</if>>{$game.game_name}</option>
</volist>
</select>
</div>
@ -58,7 +58,7 @@
<select id="group-select" name="headman_promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择组长</option>
<volist name="groupPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') === $promote['id']">selected</if>>{$promote.account}</option>
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('headman_promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>
@ -68,7 +68,7 @@
<select id="promote-select" name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广员</option>
<volist name="promotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') === $promote['id']">selected</if>>{$promote.account}</option>
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>

@ -21,9 +21,19 @@ class SsgController extends BaseController {
public function login(){
$user = session("user_auth");
$promoteId = I("promote_id");
if (!$promoteId) {
$this->error("参数非法");
}
$exists = M("promote", "tab_")->where(array('id' => $promoteId))->find();
if (!$exists) {
$this->error("参数非法.");
}
/*if ($user) {
redirect(U("ssg/index"));
}*/
$this->assign("promote_id", $promoteId);
$this->display();
}
@ -36,6 +46,15 @@ class SsgController extends BaseController {
{
$account = I("Account");
$password = I("Password");
$promoteId = I("promote_id");
if (!$promoteId) {
$this->ajaxReturn(array("ErrorCode" => -97, "ResultMsg" => "参数非法"));
}
$promote = M("promote", "tab_")->where(array('id' => $promoteId))->find();
if (!$promote) {
$this->ajaxReturn(array("ErrorCode" => -97, "ResultMsg" => "参数非法."));
}
//var_dump($password);
$verify = new \Think\Verify();
if (!$verify->check(I("VerifyCode"))) {
@ -62,6 +81,18 @@ class SsgController extends BaseController {
}
if($user_id>0){
$_SESSION['user_id'] = $user_id;
$user = M('user', 'tab_')->where(array(
'id' => $user_id
))->find();
if (!$user['promote_id']) {
M('user', 'tab_')->where(array(
'id' => $user_id
))->save(array(
'promote_id' => $promoteId,
'promote_account' => $promote['account']
));
}
}
$this->ajaxReturn(array("ErrorCode"=>$res_code,"ResultMsg"=>$res_msg),'JSON');
}
@ -95,6 +126,15 @@ class SsgController extends BaseController {
$map['a.user_id']= $user['user_id'];
$map['a.sdk_version'] = 2;
$game_list = M("user_play a","tab_")->field("b.*,b.id as game_id,od.pay_status")->join("inner join tab_game b on a.game_id=b.id left join tab_game_supersign od on od.user_id=a.user_id and od.game_id=b.id and od.pay_status=1")->where($map)->select();
if (!$game_list) {
$game_list = M("game", "tab_")->field("*, id as game_id")->where(array(
"sdk_version" => 2,
"game_status" => 1,
))->select();
foreach ($game_list as &$v) {
$v['pay_status'] = 0;
}
}
$this->assign("data_list",$game_list);
$this->display();
}

@ -5,6 +5,7 @@ use User\Api\SuserApi;
use Org\UcenterSDK\Ucservice;
use User\Api\MemberApi;
use Admin\Model\PointTypeModel;
use Think\Log;
class UserController extends BaseController {
private $suser;
@ -31,8 +32,7 @@ class UserController extends BaseController {
$member = new MemberApi();
/*是否开启Ucenter*/
if( C('UC_OPEN')==1 ){
if( C('UC_OPEN')==1 ) {
$username = $account;
//Ucenter登录
@ -142,13 +142,69 @@ class UserController extends BaseController {
}
}
$res = $this->suser->login($account,$password);file_put_contents(dirname(__FILE__) . '/login_res_text.txt',json_encode([$res]));
if($res > 0) {
$data=array(
'status' => 1,
'msg' => '登录成功',
);
$promoteId = I('post.promote_id');
$promoteId = intval($promoteId);
if ($promoteId > 0) {
$wherePromote['id'] = $promoteId;
$promoteData = M('Promote','tab_')->field('id,account')->where($wherePromote)->find();
if (!empty($promoteData)) {
$whereUser['account'] = $account;
$whereUser['_logic'] = 'or';
$whereUser['mobile_phone'] = $account;
$userData = M('User', 'tab_')->where($whereUser)->find();
if (!empty($userData)) {
if (empty($userData['promote_id'])) {
$saveData['promote_id'] = $promoteId;
$saveData['promote_account'] = $promoteData['account'];
$saveRes = M('User', 'tab_')->where(array('id'=>$userData['id']))->save($saveData);
if ($saveRes) {
$data = array(
'status' => 2,
'msg' => '登录成功!绑定成功',
);
} else {
$data = array(
'status' => 0,
'msg' => '绑定失败',
);
}
} else {
if ($userData['promote_id'] == $promoteId) {
$data = array(
'status' => 2,
'msg' => '登录成功!绑定成功',
);
} else {
$data = array(
'status' => 0,
'msg' => '号码已绑定其他推广员',
);
}
}
} else {
$data = array(
'status' => 0,
'msg' => '数据异常',
);
}
} else {
$data = array(
'status' => 0,
'msg' => '数据异常',
);
}
} else {
$data=array(
'status' => 1,
'msg' => '登录成功',
);
}
} else {
switch($res) {
case -1000: $error = '账号不存在'; break;
@ -163,6 +219,12 @@ class UserController extends BaseController {
}
echo json_encode($data);die();
} else {
$pid = I('get.pid', 0);
$gid = I('get.gid', 0);
if ($pid > 0 || $gid > 0) {
cookie('pgInfo', json_encode(['pid' => $pid, 'gid' => $gid]), 3600 * 24);
}
if($_REQUEST['url']){
$this->assign('url',base64_decode(base64_decode($_REQUEST['url'])));
}else{
@ -190,9 +252,18 @@ class UserController extends BaseController {
if (empty($password)) {
echo json_encode(array('status'=>0,'msg'=>'请输入密码'));exit;
}
$safeinfo = array('nickname' => $account, 'password' => $password, 'sex' => $sex ,'status' => 1);
$promoteId = I('post.promote_id');
$promoteId = intval($promoteId);
if ($promoteId > 0) {
$gameId = intval(I('post.game_id'));
$safeinfo = array('nickname' => $account, 'password' => $password, 'sex' => $sex ,'status' => 1,'promote_id' => $promoteId, 'game_id' => $gameId);
} else {
$safeinfo = array('nickname' => $account, 'password' => $password, 'sex' => $sex ,'status' => 1);
}
session('safeinfo',$safeinfo);
$url = U('register');
echo json_encode(array('status'=>1,'msg'=>$url));
} else{
$this->display();
@ -255,8 +326,6 @@ class UserController extends BaseController {
}
$register_way = 4;
$register_type = 2;
switch ($sex) {
@ -268,18 +337,36 @@ class UserController extends BaseController {
break;
}
if (!preg_match("/^1[34578]\d{9}$/", $phone)) {
echo json_encode(['status' => 0,'msg' => '手机号格式不正确']);
die;
}
if (!preg_match("/^[a-zA-Z0-9]{6,15}+$/", $password)) {
echo json_encode(['status' => 0,'msg' => '密码格式不正确']);
die;
}
$pgInfo = strval(cookie('pgInfo'));
Log::write('register:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($_POST) . ' --- ' . $pgInfo, 'INFO');
if (isset($_POST['promote_id']) && !empty($_POST['promote_id'])) {
$pid = $this->suser->register($phone,$password,$phone,$register_way,$register_type,$_POST['promote_id'],$_POST['promote_account'],$sex,$nickname,$head_img);
} else {
$pid = $this->suser->register($phone,$password,$phone,$register_way,$register_type,'','',$sex,$nickname,$head_img);
}
if($pid > 0){
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('Index/index'),
);
if (empty($safeinfo['promote_id'])) {
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('Index/index'),
);
} else {
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('User/login', array('pid' => $safeinfo['promote_id'], 'gid' => $safeinfo['game_id'])),
);
}
session('safeinfo',null);
} else{
$data = array(
@ -289,6 +376,12 @@ class UserController extends BaseController {
}
echo json_encode($data);
} else{
$pid = I('get.pid', 0);
$gid = I('get.gid', 0);
if ($pid > 0 || $gid > 0) {
cookie('pgInfo', json_encode(['pid' => $pid, 'gid' => $gid]), 3600 * 24);
}
if ($_REQUEST['url']) {
$url= base64_decode($_REQUEST['url']);
} else {
@ -315,6 +408,9 @@ class UserController extends BaseController {
$password = $post['password'];
$sex = $post['sex'];
$pgInfo = strval(cookie('pgInfo'));
Log::write('step1:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($post) . ' --- ' . $pgInfo, 'INFO');
/**是否开启ucenter**/
if(C('UC_OPEN')==1){
@ -369,14 +465,38 @@ class UserController extends BaseController {
if($is_setting){
echo json_encode(array('status'=>0,'msg'=>'账号已存在'));exit;
}
if (!preg_match("/^[a-z\d]{6,15}$/i", $account)) {
echo json_encode(['status' => 0,'msg' => '账号格式不正确']);
die;
}
if (!preg_match("/^[a-zA-Z0-9]{6,15}+$/", $password)) {
echo json_encode(['status' => 0,'msg' => '密码格式不正确']);
die;
}
$pid = $this->suser->register($account,$password,'',$register_way,$register_type,'','',$sex,$nickname,$head_img);
if($pid > 0){
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('Index/index'),
);
$promoteId = I('post.promote_id');
$promoteId = intval($promoteId);
if ($promoteId > 0) {
$gameId = intval(I('post.game_id'));
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('User/login', array('pid' => $promoteId, 'gid' => $gameId)),
);
} else {
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('Index/index'),
);
}
} else{
$data = array(
'status' => $pid,

@ -34,6 +34,8 @@
<i></i>
1.选择游戏产品同时,即选择购买超级签游戏下载链接和对应游戏礼包,无法退换哦~<br>
2.不同手机设备需要分别付费安装哦
<br>
<span style="color: red;">3.如您已购买个人签,请到<a style="color:red;" href="{:U('order')}" class="link"><订单查询></a>重新下载安装,无需二次购买!</span>
</div>
<div class="interval"></div>
<div class="select-product">

@ -15,6 +15,7 @@
<div class="login">
<div class="login-title">
<h2>Hello!终于等到你~</h2>
<input type="hidden" value="{$promote_id}" id="promote_id" name="promote_id"/>
</div>
<div class="login-input">
<ul>
@ -37,6 +38,7 @@
</ul>
</div>
<div class="login-btn"><a href="javascript:;" onclick="Login()">登录</a></div>
<div style="padding-top: 0.2rem;" class="login-btn"><a href="https://m.wmtxkj.com/mobile.php?s=/User/step1.html">注册</a></div>
</div>
</div>
</body>
@ -53,6 +55,7 @@
var loginName = $("#userAccount").val();
var loginPass = $("#password").val();
var userCode = $("#userCode").val();
var promoteId = $("#promote_id").val();
if (loginName == "") {
alert("账号不能为空");
return false;
@ -65,6 +68,10 @@
alert("验证码不能为空");
return false;
}
if (promoteId == "") {
alert("推广员ID不能为空");
return false;
}
jQuery.ajax({
type: 'POST',
@ -72,7 +79,8 @@
data: {
'Account':loginName,
'Password':(loginPass),
'VerifyCode':userCode
'VerifyCode':userCode,
'promote_id' :promoteId,
},
dataType: 'JSON',
xhrFields:{

@ -26,7 +26,7 @@
<if condition="$data_list">
<ul>
<volist name="data_list" id="data">
<li onclick="handleOrderDetail('{$data[\'order_id\']}','{$data[\'pay_status\']}','{$data[\'game_id\']}')">
<li onclick="handleOrderDetail('{$data[\'order_id\']}','{$data[\'pay_status\']}','{$data[\'game_id\']}','{$data[\'user_id\']}')">
<p>订单编号:{$data.order_id}</p>
<dl>
<dt><img src="{$data['icon']|get_cover='path'}"></dt>
@ -54,10 +54,10 @@
</if>
</div>
<script>
function handleOrderDetail(orderID, state, game_id) {
function handleOrderDetail(orderID, state, game_id, user_id) {
if (state == 1) {
//前往详情
window.location.href = "/sdk.php/Ipa365/install_show/order_id/"+orderID+"/game_id/"+game_id;
window.location.href = "/sdk.php/Ipa365/install_show/order_id/"+orderID+"/game_id/"+game_id+"/user_id/"+user_id;
}
}
</script>

@ -28,11 +28,15 @@
<body class="unlr">
<header class="header login-header">
<div class="">
<if condition="I('get.back') neq ''">
<a href="javascript:;history.go('{:I('get.back')}')" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<else/>
<a href="{:U('user')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
</if>
<if condition="I('get.pid') gt 0">
<a href="javascript:;history.back(-1)" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<else/>
<if condition="I('get.back') neq ''">
<a href="javascript:;history.go('{:I('get.back')}')" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<else/>
<a href="{:U('user')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
</if>
</if>
<h1 class="caption">用户登录</h1>
</div>
</header>
@ -68,7 +72,12 @@
<input type="button" class="submit" value="登录">
</div>
<div class="link-group clearfix">
<a href="{:U('User/step1')}" class="register-btn">账号注册 <font class="line">|</font> </a><a href="{:U('User/step')}" class="register-btn">&nbsp;手机注册</a>
<if condition="I('get.pid') gt 0">
<a href="<?='mobile.php?s=/User/step1/pid/'.I('get.pid').'/gid/'.I('get.gid').'.html'?>" class="register-btn">账号注册 <font class="line">|</font> </a>
<a href="<?='mobile.php?s=/User/step/pid/'.I('get.pid').'/gid/'.I('get.gid').'.html'?>" class="register-btn">&nbsp;手机注册</a>
<else/>
<a href="{:U('User/step1')}" class="register-btn">账号注册 <font class="line">|</font> </a><a href="{:U('User/step')}" class="register-btn">&nbsp;手机注册</a>
</if>
<a href="{:U('User/forget')}" class="forget-btn" style="color: #333">忘记密码</a>
</div>
</form>
@ -149,15 +158,17 @@
$('.submit').click(function(event) {
var mobile = $.trim($('#mobile').val());
var password = $.trim($('#password').val());
var promoteId = parseInt("{:I('get.pid')}") ? parseInt("{:I('get.pid')}") : 0;
var gameId = parseInt("{:I('get.gid')}") ? parseInt("{:I('get.gid')}") : 0;
if (mobile) {
if (password) {
$.ajax({
type:'POST',
url:'{:U("login")}',
data:{'phone':mobile,'password':password},
data:{'phone':mobile,'password':password,'promote_id':promoteId,'game_id':gameId},
dataType:"Json",
success:function(data){
if(data.status == 1){
if(data.status == 1 || data.status == 2){
var username = lwx.getItem('username');
if(username) {
@ -172,14 +183,19 @@
lwx.setItem('username',mobile);
pmsg.msg(data.msg);
var url = $.trim($('#login_form').attr('data-url'));
setTimeout(function(){
if (url) {
window.location.href = url;
} else {
window.location.href = "{:U('index')}";
}
},1500);
var url = $.trim($('#login_form').attr('data-url'));
setTimeout(function(){
if (data.status == 2) {
window.location.href = 'http://' + "{$_SERVER['HTTP_HOST']}" + "/index.php?s=/Home/Home/promitionofregestion/gid/" + gameId + "/pid/" + promoteId + "/status/" + "1" + ".html";
} else {
if (url) {
window.location.href = url;
} else {
window.location.href = "{:U('index')}";
}
}
},1500);
}else{
pmsg.msg(data.msg);
return false;

@ -20,7 +20,11 @@
<body class="unlr">
<header class="header forget-header">
<div class="">
<a href="{:U('login')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<if condition="I('get.pid') gt 0">
<a href="{:U('login',array('pid'=>I('get.pid'),'gid'=>I('get.gid')))}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<else/>
<a href="{:U('login')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
</if>
<h1 class="caption">注册</h1>
</div>
</header>

@ -20,7 +20,11 @@
<body class="unlr">
<header class="header forget-header">
<div class="">
<a href="{:U('login')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<if condition="I('get.pid') gt 0">
<a href="{:U('login',array('pid'=>I('get.pid'),'gid'=>I('get.gid')))}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<else/>
<a href="{:U('login')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
</if>
<h1 class="caption">注册</h1>
</div>
</header>
@ -84,6 +88,8 @@
var mobile = $.trim($('#nickname').val());
var code = $.trim($('#password').val());
var sex = $.trim($('input[name=sex]:checked').val());
var promoteId = parseInt("{:I('get.pid')}") ? parseInt("{:I('get.pid')}") : 0;
var gameId = parseInt("{:I('get.gid')}") ? parseInt("{:I('get.gid')}") : 0;
if(mobile.length == 0 ){
pmsg.msg('昵称不能为空');event.preventDefault();
return false;
@ -105,7 +111,7 @@
$.ajax({
type:'POST',
url:'{:U("User/step")}',
data:{'nickname':mobile,'password':code,'sex':sex},
data:{'nickname':mobile,'password':code,'sex':sex,'promote_id':promoteId,'game_id':gameId},
dataType:"Json",
success:function(data){
console.log(data);

@ -20,7 +20,11 @@
<body class="unlr">
<header class="header forget-header">
<div class="">
<a href="{:U('login')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<if condition="I('get.pid') gt 0">
<a href="{:U('login',array('pid'=>I('get.pid'),'gid'=>I('get.gid')))}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<else/>
<a href="{:U('login')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
</if>
<h1 class="caption">账号注册</h1>
</div>
</header>
@ -90,6 +94,9 @@
var nickname = $.trim($('#nickname').val())
var password = $.trim($('#password').val());
var sex = $.trim($('input[name=sex]:checked').val());
var promoteId = parseInt("{:I('get.pid')}") ? parseInt("{:I('get.pid')}") : 0;
var gameId = parseInt("{:I('get.gid')}") ? parseInt("{:I('get.gid')}") : 0;
if(account.length == 0 ){
pmsg.msg('账号不能为空');event.preventDefault();
return false;
@ -119,7 +126,7 @@
$.ajax({
type:'POST',
url:'{:U("User/step1")}',
data:{'account':account,'nickname':nickname,'password':password,'sex':sex},
data:{'account':account,'nickname':nickname,'password':password,'sex':sex,'promote_id':promoteId,'game_id':gameId},
dataType:"Json",
success:function(data){
pmsg.msg(data.msg);

@ -74,7 +74,7 @@ class FengHuoApiController extends Controller{
$pageSize = intval($pageSize);
$row = $pageSize ? $pageSize : 1000;
// 默认排序id降序
$order = 'id desc';
$order = 'register_time asc';
$data = M('user','tab_')
->field('id,account,promote_account,register_ip,register_time,device_type,device_number')
->where($where)
@ -131,7 +131,7 @@ class FengHuoApiController extends Controller{
$pageSize = intval($pageSize);
$row = $pageSize ? $pageSize : 1000;
// 默认排序id降序
$order = 'id desc';
$order = 'pay_time asc';
$where['pay_status'] = array('neq',0);
$data = M('spend','tab_')
@ -181,7 +181,7 @@ class FengHuoApiController extends Controller{
$pageSize = intval($pageSize);
$row = $pageSize ? $pageSize : 1000;
// 默认排序id降序
$order = 'id desc';
$order = 'play_time asc';
$data = M('user_play_info','tab_')
->field('promote_account,user_id,game_name,server_name,role_name,role_level,play_time,role_id,user_account')
->where($where)
@ -230,7 +230,7 @@ class FengHuoApiController extends Controller{
$pageSize = intval($pageSize);
$row = $pageSize ? $pageSize : 1000;
// 默认排序id降序
$order = 'id desc';
$order = 'login_time asc';
$where['login_time'] = array('neq',0);
@ -295,7 +295,7 @@ class FengHuoApiController extends Controller{
$pageSize = intval($pageSize);
$row = $pageSize ? $pageSize : 1000;
// 默认排序id降序
$order = 'm.id desc';
$order = 'm.create_time asc';
$data = M('mend as m', 'tab_')
->join('tab_user as u on m.user_id = u.id','LEFT')
->field('m.user_id,m.create_time,m.promote_account,m.promote_account_to,m.bind_type,m.user_account,u.register_time')

@ -6,9 +6,10 @@ use Mobile\Controller\SsgController;
// a8eeac3335cef5ee117d357738598f691932513b
class Ipa365Controller extends BaseController{
const signprice = 0.01; // 超级签价格
const signprice = 10; // 超级签价格
public function test(){
die();
$ipa365 = new Ipa365Controller();
$result = $ipa365->pay_notify(array(
'trade_id' => "2222",
@ -62,12 +63,16 @@ class Ipa365Controller extends BaseController{
}
public function pay_notify_test() {
die();
$this->pay_notify(array(
'order_id' => 'SS_20190924102317T2jO',
'game_id' => 1,
));
}
/**
* 订单检查
*/
public function pay_order_check() {
$orderId = I('order_id');
@ -145,8 +150,8 @@ class Ipa365Controller extends BaseController{
$param['payway'] = 1;
$param['title'] = $price;
$param['body'] = $price;
$param['callback'] = "https://api.wmtxkj.com/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://api.wmtxkj.com/callback.php/Notify/notify/apitype/alipay";
$param['callback'] = "https://m.wmtxkj.com/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://m.wmtxkj.com/callback.php/Notify/notify/apitype/alipay";
$ret = $this->alipay($param);
@ -190,8 +195,8 @@ class Ipa365Controller extends BaseController{
$param['payway'] = 1;
$param['title'] = $price;
$param['body'] = $price;
$param['callback'] = "https://api.wmtxkj.com/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://api.wmtxkj.com/callback.php/Notify/notify/apitype/alipay";
$param['callback'] = "https://m.wmtxkj.com/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://m.wmtxkj.com/callback.php/Notify/notify/apitype/alipay";
$ret = $this->alipay($param);
@ -209,8 +214,13 @@ class Ipa365Controller extends BaseController{
public function install_show() {
$orderId = I('order_id', 0);
$gameId = I('game_id', 0);
$userId = I('user_id', 0);
$userId = $_SESSION['user_id'];
$user = M('user', 'tab_')->where(array(
'id' => $userId
))->find();
// $userId = $_SESSION['user_id'];
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
@ -258,7 +268,7 @@ class Ipa365Controller extends BaseController{
* 用户点击安装
*/
public function install() {
$userId = $_SESSION['user_id'];
$userId = I('user_id', 0);
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}

@ -146,6 +146,9 @@ class SpendController extends Controller {
$this->display ( 'pay_success' );
}
public function pay_error() {
$Scheme = file_get_contents ( "./Application/Sdk/Scheme/" . $_GET ['game_id'] . ".txt" );
$this->assign ('Scheme', $Scheme?$Scheme:'txplatformsdk');
$this->display ();
}
public function notice($user_id = 0, $game_id = 0, $msg = '') {

@ -670,10 +670,9 @@ class UserController extends BaseController
$user = json_decode(base64_decode(file_get_contents("php://input")), true);
#判断数据是否为空
if (empty($user)) {
$this -> set_message(1001, "fail", "注册数据不能为空");
}
Log::write('user_register:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($user), 'INFO');
/**是否开启ucenter**/
if (C('UC_OPEN') == 1) {
//Ucenter注册
@ -720,10 +719,10 @@ class UserController extends BaseController
#获取SDK上POST方式传过来的数据 然后base64解密 然后将json字符串转化成数组
$user = json_decode(base64_decode(file_get_contents("php://input")), true);
if (empty($user)) {
$this -> set_message(1001, "fail", "注册数据不能为空");
}
Log::write('user_email_register:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($user), 'INFO');
$v_res = $this -> verify_email_code($user['account'], $user['code']);
if ($v_res) {
@ -745,10 +744,9 @@ class UserController extends BaseController
$user = json_decode(base64_decode(file_get_contents("php://input")), true);
#判断数据是否为空
if (empty($user)) {
$this -> set_message(1001, "fail", "注册数据不能为空");
}
Log::write('user_phone_register:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($user), 'INFO');
#验证短信验证码
$this -> sms_verify($user['account'], $user['code']);
/**是否开启ucenter**/

@ -69,7 +69,7 @@
<span>{$price}元</span>
</div>
<a class="order-payinfo-item"
href="#;" onclick="jump('{$order_id}')"
href="#;" onclick="jump('{$url}', '{$order_id}')"
title="支付宝">
<div class="order-payinfo-icon">
<img src="__IMG__/ssg/alipay/zfb-pic.jpg" alt="支付宝">
@ -86,9 +86,9 @@
</div>
</body>
<script>
function jump(pay_url) {
function jump(pay_url, order_id) {
if(isWeiXin()){
window.location.href = "/sdk.php/Ipa365/paytip/order_id/"+pay_url;
window.location.href = "/sdk.php/Ipa365/paytip/order_id/"+order_id;
}else{
window.location.href=pay_url;
}

@ -41,6 +41,7 @@ border: 1px solid #999;
</style>
<div class="news_area" style="padding:0px;">
<input type="hidden" value="{$Scheme}" id="scheme"/>
<!--未绑定-->
<div class="pay_suc">
@ -48,7 +49,7 @@ border: 1px solid #999;
<h3>支付失败</h3>
<!-- <p>商品名称: 赤月传说</p> -->
<!-- <p>商品金额: 8887845</p> -->
<a href="mengchuang://showWapPayResult_btnType_?0&back">返回</a>
<a href="{$Scheme}://showWapPayResult_btnType_?0&back">返回</a>
</div>
<!--未绑定结束-->
@ -62,8 +63,21 @@ border: 1px solid #999;
<script type="text/javascript">
$(function(){
location.href = "mengchuang://showWapPayResult_btnType_?0&ss";
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
try{
if(isAndroid){
window.mengchuang.getPayResult('fail');
}else{
window.webkit.messageHandlers.exchangeResult.postMessage(0);
}
}catch(err){
/* setTimeout(function () {
window.location.href= "/mobile.php?s=/User/index.html";
},1000) */
}
// location.href = $("#scheme").val()+"://showWapPayResult_btnType_?0&ss";
})
</script>

@ -29,9 +29,14 @@ class MemberApi extends Api{
return $this->model->register($data);
}
public function sdk_register($data){
public function sdk_register($data){
return $this->model->sdk_register($data);
}
public function wap_register($data){
return $this->model->wap_register($data);
}
/**
* 注册一个新用户user表加game_id
* @param string $account 用户名

@ -102,7 +102,7 @@ class UcenterMemberModel extends Model{
* @param string $mobile 用户手机号码
* @return integer 注册成功-用户信息,注册失败-错误编号
*/
public function register($username, $password, $email,$second_pwd,$mobile){
public function register($username, $password, $email, $second_pwd,$mobile){
$data = array(
'username' => $username,
'password' => $password,
@ -110,14 +110,19 @@ class UcenterMemberModel extends Model{
'email' => $email,
'mobile' => $mobile,
);
//验证手机
if(empty($data['mobile'])) unset($data['mobile']);
/* 添加用户 */
if($this->create($data)){
$uid = $this->add();
return $uid ? $uid : 0; //0-未知错误大于0-注册成功
if($data = $this->create($data)){
$data['username'] = $username;
$data['email'] = $email;
$status = M('UcenterMember', 'sys_')->data($data)->add();
$uid = 0;
if ($status) {
$uid = M()->getLastInsID();
}
return $uid; //0-未知错误大于0-注册成功
} else {
return $this->getError(); //错误详情见自动验证注释
}

@ -58,3 +58,7 @@ INSERT INTO `tab_promote_quick_menu` VALUES ('14', '1', '8', '1569719866');
INSERT INTO `tab_promote_quick_menu` VALUES ('15', '1', '9', '1569719870');
INSERT INTO `tab_promote_quick_menu` VALUES ('16', '1', '10', '1569719877');
INSERT INTO `tab_promote_quick_menu` VALUES ('18', '1', '1', '1569720739');
-- 2019-10-01
alter table tab_game_source add column `original_url` varchar(255) NOT NULL default '' COMMENT '原包路径';
alter table tab_game_source add column `org_plist_url` varchar(255) NOT NULL default '' COMMENT '原包Plist路径';

@ -66,7 +66,7 @@ class Alipay extends \Think\Pay\Pay
$param['return_url'] = $returnUrl;
else
$param['return_url']='http://' . $_SERVER ['HTTP_HOST'] . "/sdk.php/Spend/pay_success";
$param['show_url'] = 'http://' . $_SERVER ['HTTP_HOST'] . "/sdk.php/Spend/pay_error";
$param['show_url'] = 'http://' . $_SERVER ['HTTP_HOST'] . "/sdk.php/Spend/pay_error/game_id/".$vo->getGameId();
break;
case 'refund':
$param['seller_email'] = $this->config['email'];

Loading…
Cancel
Save