Merge branch 'dev'

master
ELF 5 years ago
commit 2f5a8c7002

@ -85,7 +85,7 @@ function get_list_field($data, $grid)
/**
* [every_day 获取日期]
* @param integer $m [description]
* @param integer $m [description]
* @return [type] [array]
*/
function every_day($m = 7)
@ -293,7 +293,6 @@ function get_config_group($group = 0)
* '字段名2'=>array(映射关系数组),
* ......
* )
* @author 朱亚杰 <zhuyajie@topthink.net>
* @return array
*
* array(
@ -301,6 +300,7 @@ function get_config_group($group = 0)
* ....
* )
*
* @author 朱亚杰 <zhuyajie@topthink.net>
*/
function int_to_string(&$data, $map = array('status' => array(1 => '正常', -1 => '删除', 0 => '锁定', 2 => '未审核', 3 => '草稿')))
{
@ -365,7 +365,7 @@ function get_parent_category($cid)
/**
* 检测验证码
* @param integer $id 验证码ID
* @param integer $id 验证码ID
* @return boolean 检测结果
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
@ -522,3 +522,9 @@ function get_action_type($type, $all = false)
return $list[$type];
}
//获取服务器类型
function getServerType($serverType)
{
return (($serverType == 1) ? '专服' : '混服');
}

@ -40,6 +40,10 @@ class GameController extends ThinkController
$extend['sdk_version'] = $_REQUEST['sdk_version1'];
unset($_REQUEST['sdk_version1']);
}
if (!empty($_REQUEST['server_type'])) {
$extend['server_type'] = intval($_REQUEST['server_type']);
unset($_REQUEST['server_type']);
}
if (isset($_REQUEST['recommend_status'])) {
$extend['recommend_status'] = $_REQUEST['recommend_status'];
unset($_REQUEST['recommend_status']);

@ -0,0 +1,137 @@
<?php
namespace Admin\Controller;
class PersonalMenusController extends ThinkController{
public function lists()
{
$sdkMenus = M('tool','tab_')->where(['name' => 'personal_menu'])->find();
$config = json_decode($sdkMenus['config'],true);
if(!empty($config))
{
foreach($config as $k => $v)
{
$config[$k]['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon'];
}
}
$this->assign('list',$config);
$this->meta_title = '个人中心列表';
$this->display('lists');
}
public function add()
{
$sdkMenus = M('tool','tab_')->where(['name' => 'personal_menu'])->find();
$config = json_decode($sdkMenus['config'],true);
if(!empty($config))
{
$config1 = $config;
$id = array_pop($config1);
$id = $id['id'] + 1;
}else
{
$config = [];
$id = 1;
}
if(IS_POST)
{
$post = I('post.');
$post['id'] = $id;
array_push($config,$post);
$sdkMenus['config'] = json_encode($config);
if(empty($sdkMenus['name']))
{
$sdkMenus['name'] = 'personal_menu';
$sdkMenus['title'] = '个人中心列表';
$sdkMenus['status'] = 1;
$sdkMenus['create_time'] = time();
M('tool','tab_')->data($sdkMenus)->add();
}else
{
M('tool','tab_')->where(['name' => 'personal_menu'])->data($sdkMenus)->save();
}
$this->success('新增成功', U('lists'));
}
$data['sort'] = $id;
$this->meta_title = '个人中心列表';
$this->assign('type','add');
$this->assign('data',$data);
$this->display('add');
}
public function edit($id)
{
$sdkMenus = M('tool','tab_')->where(['name' => 'personal_menu'])->find();
$config = json_decode($sdkMenus['config'],true);
if(IS_POST)
{
foreach($config as $k => $v)
{
if($v['id'] == $id)
{
$post = I('post.');
foreach($post as $key => $val)
{
if($key == 'icon')
{
$config[$k][$key] = strstr($val,'/Upload');
}else
{
$config[$k][$key] = $val;
}
}
break;
}
}
$sdkMenus['config'] = json_encode($config);
M('tool','tab_')->where(['name' => 'personal_menu'])->data($sdkMenus)->save();
$this->success('修改成功', U('lists'));
}
$data = [];
foreach($config as $k => $v)
{
if($v['id'] == $id)
{
$v['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon'];
$data = $v;
break;
}
}
if(empty($data))
{
$this->error('菜单不存在','lists');
}
$this->meta_title = '个人中心列表';
$this->assign('type','edit');
$this->assign('data',$data);
$this->display('add');
}
public function del($id)
{
if(!is_array($id))
{
$data[] = $id;
}else
{
$data = $id;
}
$sdkMenus = M('tool','tab_')->where(['name' => 'personal_menu'])->find();
$config = json_decode($sdkMenus['config'],true);
foreach($config as $k => $v)
{
if(in_array($v['id'], $data))
{
unset($config[$k]);
}
}
$sdkMenus['config'] = json_encode($config);
M('tool','tab_')->where(['name' => 'personal_menu'])->data($sdkMenus)->save();
$this->success('删除成功', U('lists'));
}
}

@ -0,0 +1,135 @@
<?php
namespace Admin\Controller;
class SdkMenuController extends ThinkController{
public function lists()
{
$sdkMenus = M('tool','tab_')->where(['name' => 'sdk_menu'])->find();
$config = json_decode($sdkMenus['config'],true);
if(!empty($config))
{
foreach($config as $k => $v)
{
$config[$k]['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon'];
}
}
$this->assign('list',$config);
$this->meta_title = '悬浮球菜单';
$this->display('lists');
}
public function add()
{
$sdkMenus = M('tool','tab_')->where(['name' => 'sdk_menu'])->find();
$config = json_decode($sdkMenus['config'],true);
if(!empty($config))
{
$config1 = $config;
$id = array_pop($config1);
$id = $id['id'] + 1;
}else
{
$config = [];
$id = 1;
}
if(IS_POST)
{
$post = I('post.');
$post['id'] = $id;
array_push($config,$post);
$sdkMenus['config'] = json_encode($config);
if(empty($sdkMenus['name']))
{
$sdkMenus['name'] = 'sdk_menu';
$sdkMenus['title'] = '悬浮球菜单';
M('tool','tab_')->data($sdkMenus)->add();
}else
{
M('tool','tab_')->where(['name' => 'sdk_menu'])->data($sdkMenus)->save();
}
$this->success('新增成功', U('lists'));
}
$data['sort'] = $id;
$this->meta_title = '悬浮球菜单';
$this->assign('type','add');
$this->assign('data',$data);
$this->display('add');
}
public function edit($id)
{
$sdkMenus = M('tool','tab_')->where(['name' => 'sdk_menu'])->find();
$config = json_decode($sdkMenus['config'],true);
if(IS_POST)
{
foreach($config as $k => $v)
{
if($v['id'] == $id)
{
$post = I('post.');
foreach($post as $key => $val)
{
if($key == 'icon')
{
$config[$k][$key] = strstr($val,'/Upload');
}else
{
$config[$k][$key] = $val;
}
}
break;
}
}
$sdkMenus['config'] = json_encode($config);
M('tool','tab_')->where(['name' => 'sdk_menu'])->data($sdkMenus)->save();
$this->success('修改成功', U('lists'));
}
$data = [];
foreach($config as $k => $v)
{
if($v['id'] == $id)
{
$v['icon'] = is_https()?'https://':'http://' . $_SERVER['SERVER_NAME'] . $v['icon'];
$data = $v;
break;
}
}
if(empty($data))
{
$this->error('菜单不存在','lists');
}
$this->meta_title = '悬浮球菜单';
$this->assign('type','edit');
$this->assign('data',$data);
$this->display('add');
}
public function del($id)
{
if(!is_array($id))
{
$data[] = $id;
}else
{
$data = $id;
}
$sdkMenus = M('tool','tab_')->where(['name' => 'sdk_menu'])->find();
$config = json_decode($sdkMenus['config'],true);
foreach($config as $k => $v)
{
if(in_array($v['id'], $data))
{
unset($config[$k]);
}
}
$sdkMenus['config'] = json_encode($config);
M('tool','tab_')->where(['name' => 'sdk_menu'])->data($sdkMenus)->save();
$this->success('删除成功', U('lists'));
}
}

@ -85,6 +85,13 @@ text-indent:0;
<input type="hidden" id="sdk_version" name="sdk_version" value="{:I('sdk_version')}">
</select>
</div>
<div class="input-list input-list-platform">
<select id="server_type" name="server_type" >
<option value="">混服管理</option>
<option value="1">专服</option>
<option value="2">混服</option>
</select>
</div>
<empty name="show_status">
<div class="input-list input-list input-list-platform">
<select id="recommend_status" name="recommend_status">
@ -127,6 +134,7 @@ text-indent:0;
<th>游戏ID</th>
<th>游戏名称</th>
<th>运营平台</th>
<th>混服管理</th>
<th>游戏类型</th>
<th>游戏Appid</th>
<th>推荐状态</th>
@ -150,7 +158,8 @@ text-indent:0;
<td>{$data.id}</td>
<td>{$data.game_name}</td>
<td class="">{:get_systems_name($data['sdk_version'])}</td>
<td>{:getServerType($data['server_type'])}</td>
<td>{:get_game_type_name($data['game_type_id'])}</td>
<td>{$data.game_appid}</td>
<td>{:get_info_status($data['recommend_status'],1)}</td>

@ -65,6 +65,21 @@
<span class="notice-text">显示该游戏所适用的平台,一般为安卓平台和苹果平台</span>
</td>
</tr>
<tr>
<td class="l noticeinfo">混服设置</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<eq name="data.server_type" value="1">
<input type="radio" class="inp_radio" value="1" name="server_type" checked> 专服
<else/>
<input type="radio" class="inp_radio" value="2" name="server_type" checked> 混服
</eq>
</label>
</span>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">开放类型</td>
<td class="r table_radio">

@ -0,0 +1,152 @@
<extend name="Public/base"/>
<block name="body">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text"></p>
</div>
<div class="tab-content tabcon1711 tabcon17112">
<IF condition="$type == edit">
<form action="{:U('edit')}" method="post" class="form-horizontal form_info_ml">
<else />
<form action="{:U('add')}" method="post" class="form-horizontal form_info_ml">
</IF>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l noticeinfo">菜单名称</td>
<td class="r table_radio">
<input type="text" class="" name="name" value="{$data.name|default=''}" >
</td>
</tr>
<tr>
<td class="l noticeinfo">菜单标题</td>
<td class="r table_radio">
<input type="text" class="" name="title" value="{$data.title|default=''}" >
</td>
</tr>
<tr>
<td class="l noticeinfo">菜单链接</td>
<td class="r table_radio">
<input type="text" class="" name="url" value="{$data.url|default=''}" >
</td>
</tr>
<tr>
<td class="l noticeinfo">url类型</td>
<td class="r table_radio">
<span class="form_select">
<select name="type">
<IF condition="$data['type'] == '0'">
<option value="0" selected="selected">h5页面</option>
<option value="1">原生</option>
<ELSE />
<option value="1" selected="selected">原生</option>
<option value="0">h5页面</option>
</IF>
</select>
</span>
</td>
</tr>
<tr>
<td class="l noticeinfo">跳转目标</td>
<td class="r table_radio">
<input type="text" class="" name="act" value="{$data.act|default=''}" placeholder='url类型为原生时填写'>
</td>
</tr>
<tr>
<td class="l noticeinfo">IOS链接</td>
<td class="r table_radio">
<input type="text" class="" name="ios_url" value="{$data.ios_url|default=''}">
</td>
</tr>
<tr>
<td class="l noticeinfo">排序</td>
<td class="r table_radio">
<input type="text" class="" name="sort" value="{$data.sort|default=''}">
</td>
</tr>
<tr class="picbox">
<td class="l noticeinfo">菜单图标</td>
<td class="r table_radio">
<span class="form_icon table_btn table_upload">
<input type="file" id="upload_picture_icon">
<input type="hidden" name="icon" id="cover_id_icon" value="{$data.icon}" />
<div class="upload-img-box">
<notempty name="data['icon']">
<div class="upload-pre-item">
<span class="placeholder-graphic placeholder-graphic_icon"><img src="{$data['icon']}"/></span>
</div>
</notempty>
</div>
</span>
<span class="notice-text" style="left:215px;">菜单图标</span>
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="id" value="{:I('id')}">
<script type="text/javascript">
//上传图片
/* 初始化上传插件 */
//上传游戏图标
/* 初始化上传插件 */
$("#upload_picture_icon").uploadify({
"height" : 30,
"swf" : "__STATIC__/uploadify/uploadify.swf",
"fileObjName" : "download",
"buttonText" : "上传图标",
"uploader" : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
"width" : 120,
'removeTimeout' : 1,
'fileTypeExts' : '*.jpg; *.jpeg; *.png; *.gif;',
"onUploadSuccess" : upload_picture_icon{$field.name},
'onFallback' : function() {
alert('未检测到兼容版本的Flash.');
}
});
function upload_picture_icon{$field.name}(file, data){
var data = $.parseJSON(data);
var src = '';
if(data.status){
src = data.path || data.url;
$("#cover_id_icon").val(src);
$("#cover_id_icon").parent().find('.upload-img-box').html(
'<div class="upload-pre-item"><span class="placeholder-graphic placeholder-graphic_icon"><img src="' + src + '"/></span></div>'
);
} else {
updateAlert(data.info);
setTimeout(function(){
$('#top-alert').find('button').click();
$(that).removeClass('disabled').prop('disabled',false);
},1500);
}
}
</script>
</form>
<div class="form-item cf">
<button class="submit_btn ajax-post mlspacing" id="submit" type="submit" target-form="form-horizontal">
保存
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
返回
</a>
</div>
</div>
</block>
<block name="script">
<script type="text/javascript" charset="utf-8">
//导航高亮
highlight_subnav('{:U('SdkMenu/lists')}');
</script>
</block>

@ -0,0 +1,177 @@
<extend name="Public/base"/>
<block name="body">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text"></p>
<div class="fr">
<a href="{:U('SdkMenu/lists')}">悬浮窗菜单</a>
<a class="tabchose" href="{:U('PersonalMenus/lists')}">个人用户中心菜单</a>
</div>
</div>
<div class="cf top_nav_list">
<div class="fl button_list">
<a class="" href="{:U('add')}"><span class="button_icon button_icon1"></span>新增</a>
<a class=" ajax-post confirm" url="{:U('del')}" target-form="ids"><span class="button_icon button_icon2"></span>删 除</a>
</div>
</div>
<div class="data_list">
<table style="text-align:center">
<thead>
<tr>
<th>
<input class="checkbox check-all" type="checkbox">
</th>
<th style="text-align:center">ID</th>
<th style="text-align:center">菜单名称</th>
<th style="text-align:center">菜单标题</th>
<th style="text-align:center">菜单图标</th>
<th style="text-align:center">菜单链接</th>
<th style="text-align:center">url类型</th>
<th style="text-align:center">跳转目标</th>
<th style="text-align:center">IOS链接</th>
<th style="text-align:center">排序</th>
<th style="text-align:center">操作</th>
</tr>
</thead>
<tbody>
<notempty name="list">
<volist name="list" id="channel">
<tr>
<td><input class="ids" type="checkbox" name="id[]" value="{$channel.id}"></td>
<td>{$channel.id}</td>
<td>{$channel.name}</td>
<td>{$channel.title}</td>
<td><img src="{$channel.icon}"></td>
<td>{$channel.url}</td>
<IF condition="$channel.type == 1">
<td>原生</td>
<ELSE />
<td>H5页面</td>
</IF>
<td>{$channel.act}</td>
<td>{$channel.ios_url}</td>
<td>
<div name="sort" data-title="{$channel.game_name} 排序设置" game-id="{$channel.id}" class="tab_not_same editTab">
<span class="w70">{$channel.sort}</span>
</div>
</td>
<td>
<a title="编辑" href="{:U('edit?id='.$channel['id'].'&pid='.$pid)}">编辑</a>
<a class="confirm ajax-get" title="删除" href="{:U('del?id='.$channel['id'])}">删除</a>
</td>
</tr>
</volist>
<else/>
<td colspan="11" class="text-center">aOh! 暂时还没有内容!</td>
</notempty>
</tbody>
</table>
</div>
<div class="page">
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="{$m_url}">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js"></script>
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('SdkMenu/lists')}');
Think.setValue('row',"{:I('row',10)}");
$(function() {
//点击排序
$('.list_sort').click(function(){
var url = $(this).attr('url');
var ids = $('.ids:checked');
var param = '';
if(ids.length > 0){
var str = new Array();
ids.each(function(){
str.push($(this).val());
});
param = str.join(',');
}
if(url != undefined && url != ''){
window.location.href = url + '/ids/' + param;
}
});
});
$('.editTab').click(function() {
var that = $(this),num = $.trim(that.children().text());
var id = that.attr('game-id');
var names = that.attr('name');
var title = that.attr('data-title');
layer.prompt({title:title,formType:0},function(value,index) {
if (!/^(?:0|[1-9][0-9]*)$/.test(value)) {
updateAlert('请输入正整数','tip_error');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},2000);
return false;
}
layer.close(index);
var arr = {};
arr.id = id;
arr[names] = value;
$.ajax({
async: false,
url:"{:U('edit')}",
type:"POST",
dataType:"json",
data:arr,
success:function(result){
if(result.status){
//layer.msg('修改成功',{icon: 1});
updateAlert('修改成功');
setTimeout(function(){
$('#tip').find('.tipclose').click();
window.location.reload();
},2000);
}else{
//layer.msg('修改失败',{icon: 2});
updateAlert('修改失败','tip_error');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},2000);
}
},
error:function(){
//layer.msg('服务器异常');
updateAlert('服务器异常','tip_error');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},2000);
}
});
});
return false;
});
</script>
</block>

@ -0,0 +1,152 @@
<extend name="Public/base"/>
<block name="body">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text"></p>
</div>
<div class="tab-content tabcon1711 tabcon17112">
<IF condition="$type == edit">
<form action="{:U('edit')}" method="post" class="form-horizontal form_info_ml">
<else />
<form action="{:U('add')}" method="post" class="form-horizontal form_info_ml">
</IF>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l noticeinfo">菜单名称</td>
<td class="r table_radio">
<input type="text" class="" name="name" value="{$data.name|default=''}" >
</td>
</tr>
<tr>
<td class="l noticeinfo">菜单标题</td>
<td class="r table_radio">
<input type="text" class="" name="title" value="{$data.title|default=''}" >
</td>
</tr>
<tr>
<td class="l noticeinfo">菜单链接</td>
<td class="r table_radio">
<input type="text" class="" name="url" value="{$data.url|default=''}" >
</td>
</tr>
<tr>
<td class="l noticeinfo">url类型</td>
<td class="r table_radio">
<span class="form_select">
<select name="type">
<IF condition="$data['type'] == '0'">
<option value="0" selected="selected">h5页面</option>
<option value="1">原生</option>
<ELSE />
<option value="1" selected="selected">原生</option>
<option value="0">h5页面</option>
</IF>
</select>
</span>
</td>
</tr>
<tr>
<td class="l noticeinfo">跳转目标</td>
<td class="r table_radio">
<input type="text" class="" name="act" value="{$data.act|default=''}" placeholder='url类型为原生时填写'>
</td>
</tr>
<tr>
<td class="l noticeinfo">IOS链接</td>
<td class="r table_radio">
<input type="text" class="" name="ios_url" value="{$data.ios_url|default=''}">
</td>
</tr>
<tr>
<td class="l noticeinfo">排序</td>
<td class="r table_radio">
<input type="text" class="" name="sort" value="{$data.sort|default=''}">
</td>
</tr>
<tr class="picbox">
<td class="l noticeinfo">菜单图标</td>
<td class="r table_radio">
<span class="form_icon table_btn table_upload">
<input type="file" id="upload_picture_icon">
<input type="hidden" name="icon" id="cover_id_icon" value="{$data.icon}" />
<div class="upload-img-box">
<notempty name="data['icon']">
<div class="upload-pre-item">
<span class="placeholder-graphic placeholder-graphic_icon"><img src="{$data['icon']}"/></span>
</div>
</notempty>
</div>
</span>
<span class="notice-text" style="left:215px;">菜单图标</span>
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="id" value="{:I('id')}">
<script type="text/javascript">
//上传图片
/* 初始化上传插件 */
//上传游戏图标
/* 初始化上传插件 */
$("#upload_picture_icon").uploadify({
"height" : 30,
"swf" : "__STATIC__/uploadify/uploadify.swf",
"fileObjName" : "download",
"buttonText" : "上传图标",
"uploader" : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
"width" : 120,
'removeTimeout' : 1,
'fileTypeExts' : '*.jpg; *.jpeg; *.png; *.gif;',
"onUploadSuccess" : upload_picture_icon{$field.name},
'onFallback' : function() {
alert('未检测到兼容版本的Flash.');
}
});
function upload_picture_icon{$field.name}(file, data){
var data = $.parseJSON(data);
var src = '';
if(data.status){
src = data.path || data.url;
$("#cover_id_icon").val(src);
$("#cover_id_icon").parent().find('.upload-img-box').html(
'<div class="upload-pre-item"><span class="placeholder-graphic placeholder-graphic_icon"><img src="' + src + '"/></span></div>'
);
} else {
updateAlert(data.info);
setTimeout(function(){
$('#top-alert').find('button').click();
$(that).removeClass('disabled').prop('disabled',false);
},1500);
}
}
</script>
</form>
<div class="form-item cf">
<button class="submit_btn ajax-post mlspacing" id="submit" type="submit" target-form="form-horizontal">
保存
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
返回
</a>
</div>
</div>
</block>
<block name="script">
<script type="text/javascript" charset="utf-8">
//导航高亮
highlight_subnav('{:U('SdkMenu/lists')}');
</script>
</block>

@ -0,0 +1,178 @@
<extend name="Public/base"/>
<block name="body">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text"></p>
<div class="fr">
<a class="tabchose" href="{:U('SdkMenu/lists')}">悬浮窗菜单</a>
<a href="{:U('PersonalMenus/lists')}">个人用户中心菜单</a>
</div>
</div>
<div class="cf top_nav_list">
<div class="fl button_list">
<a class="" href="{:U('add')}"><span class="button_icon button_icon1"></span>新增</a>
<a class=" ajax-post confirm" url="{:U('del')}" target-form="ids"><span class="button_icon button_icon2"></span>删 除</a>
</div>
</div>
<div class="data_list">
<table style="text-align:center">
<thead>
<tr>
<th>
<input class="checkbox check-all" type="checkbox">
</th>
<th style="text-align:center">ID</th>
<th style="text-align:center">菜单名称</th>
<th style="text-align:center">菜单标题</th>
<th style="text-align:center">菜单图标</th>
<th style="text-align:center">菜单链接</th>
<th style="text-align:center">url类型</th>
<th style="text-align:center">跳转目标</th>
<th style="text-align:center">IOS链接</th>
<th style="text-align:center">排序</th>
<th style="text-align:center">操作</th>
</tr>
</thead>
<tbody>
<notempty name="list">
<volist name="list" id="channel">
<tr>
<td><input class="ids" type="checkbox" name="id[]" value="{$channel.id}"></td>
<td>{$channel.id}</td>
<td>{$channel.name}</td>
<td>{$channel.title}</td>
<td><img src="{$channel.icon}"></td>
<td>{$channel.url}</td>
<IF condition="$channel.type == 1">
<td>原生</td>
<ELSE />
<td>H5页面</td>
</IF>
<td>{$channel.act}</td>
<td>{$channel.ios_url}</td>
<td>
<div name="sort" data-title="{$channel.game_name} 排序设置" game-id="{$channel.id}" class="tab_not_same editTab">
<span class="w70">{$channel.sort}</span>
</div>
</td>
<td>
<a title="编辑" href="{:U('edit?id='.$channel['id'].'&pid='.$pid)}">编辑</a>
<a class="confirm ajax-get" title="删除" href="{:U('del?id='.$channel['id'])}">删除</a>
</td>
</tr>
</volist>
<else/>
<td colspan="11" class="text-center">aOh! 暂时还没有内容!</td>
</notempty>
</tbody>
</table>
</div>
<div class="page">
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="{$m_url}">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js"></script>
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('SdkMenu/lists')}');
Think.setValue('row',"{:I('row',10)}");
$(function() {
//点击排序
$('.list_sort').click(function(){
var url = $(this).attr('url');
var ids = $('.ids:checked');
var param = '';
if(ids.length > 0){
var str = new Array();
ids.each(function(){
str.push($(this).val());
});
param = str.join(',');
}
if(url != undefined && url != ''){
window.location.href = url + '/ids/' + param;
}
});
});
$('.editTab').click(function() {
var that = $(this),num = $.trim(that.children().text());
var id = that.attr('game-id');
var names = that.attr('name');
var title = that.attr('data-title');
layer.prompt({title:title,formType:0},function(value,index) {
if (!/^(?:0|[1-9][0-9]*)$/.test(value)) {
updateAlert('请输入正整数','tip_error');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},2000);
return false;
}
layer.close(index);
var arr = {};
arr.id = id;
arr[names] = value;
$.ajax({
async: false,
url:"{:U('edit')}",
type:"POST",
dataType:"json",
data:arr,
success:function(result){
if(result.status){
//layer.msg('修改成功',{icon: 1});
updateAlert('修改成功');
setTimeout(function(){
$('#tip').find('.tipclose').click();
window.location.reload();
},2000);
}else{
//layer.msg('修改失败',{icon: 2});
updateAlert('修改失败','tip_error');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},2000);
}
},
error:function(){
//layer.msg('服务器异常');
updateAlert('服务器异常','tip_error');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},2000);
}
});
});
return false;
});
</script>
</block>

@ -61,7 +61,7 @@ function str2arr($str, $glue = ',')
* @return string
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
function arr2str($arr, $glue = ',')
function arr2str($arr=[], $glue = ',')
{
return implode($glue, $arr);
}

@ -270,9 +270,9 @@ class PromoteController extends BaseController
//$count = M("server", "tab_")->where($map)->count();
foreach ($open_server_list as $key => $server) {
$open_server_list[$key]['icon'] = get_cover($server['icon'], 'path');
if ($server['pay_type'] == 1) {
if ($server['server_version'] == 1) {
$open_server_list[$key]['pay_type'] = '安卓';
} elseif ($server['pay_type'] == 1) {
} elseif ($server['server_version'] == 2) {
$open_server_list[$key]['pay_type'] = 'iOS';
} else {
$open_server_list[$key]['pay_type'] = '安卓、iOS';
@ -315,7 +315,7 @@ class PromoteController extends BaseController
)->delete();
$this->ajaxReturn(['status' => 1, 'info' => '移除成功'], "JSON");
} else {
$menuData = M("promote_quick_menu ", "tab_")->count();
$menuData = M("promote_quick_menu ", "tab_")->where(array("promote_id" => get_pid()))->count();
if ($menuData>=10) {
$this->ajaxReturn(['status' => 1, 'info' => '快捷菜单只能有10个'], "JSON");

@ -2303,14 +2303,8 @@ class QueryController extends BaseController
public function getChildPromoteList()
{
$promoteId = I('post.promote_id', 0);
if ($promoteId == 0) {
$data['status'] = 0;
$data['msg'] = '数据异常';
$this->ajaxReturn($data);
}
$promoteId = intval(I('post.promote_id', 0));
$promoteId = empty($promoteId) ? PID : $promoteId;
$promoteList = getAllPromoteListByType(3, false, $promoteId);
$data['status'] = 1;
$data['data'] = $promoteList;

@ -31,15 +31,15 @@ class TestResourceController extends BaseController
$map['tab_test_resource.role_name']=['like','%'.I('role_name').'%'];
}
if(!empty(I('user_account'))){
$map['tab_test_resource.user_account']=I('user_account');
$map['tab_test_resource.user_account']=['like','%'.I('user_account').'%'];
}
if(!empty(I('promote_name'))){
$map['tab_test_resource.promote_account']=I('promote_name');
$map['tab_test_resource.promote_account']=['like','%'.I('promote_name').'%'];
}
$map['user.promote_id']=session("promote_auth.pid");
$data = M('test_resource','tab_')
->field('tab_test_resource.id,tab_test_resource.user_id,tab_test_resource.game_name,tab_test_resource.server_name,tab_test_resource.user_account,tab_test_resource.promote_account,tab_test_resource.role_name,tab_test_resource.create_time,device_number,check_status')
->field('tab_test_resource.id,tab_test_resource.user_id,tab_test_resource.game_name,tab_test_resource.server_name,tab_test_resource.user_account,tab_test_resource.promote_account,tab_test_resource.role_name,tab_test_resource.create_time,device_number,lock_status as check_status')
->join('left join tab_user as user on tab_test_resource.user_id = user.id')
->where($map)
->page($page,$row)
@ -74,7 +74,7 @@ class TestResourceController extends BaseController
}
$data = [
'check_status' => 0
'lock_status' => 0
];
$isFreeze = M('user','tab_')->where("id=".$supportId)->save($data);
@ -93,7 +93,7 @@ class TestResourceController extends BaseController
}
$data = [
'check_status' => 1
'lock_status' => 1
];
$isFreeze = M('user','tab_')->where("id=".$supportId)->save($data);
@ -246,7 +246,7 @@ class TestResourceController extends BaseController
parent::_initialize();
$map['id'] = get_pid();
$pro = M("promote", "tab_")->where($map)->find();
if ($pro['parent_id']!=0) {
if ($pro['parent_id']!=0&&!($pro['parent_id']>0&&$pro['grand_id']==0)) {
$this->error('无权操作!');
}
}
@ -282,6 +282,9 @@ class TestResourceController extends BaseController
$map['create_time'] = array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1));
unset($_REQUEST['start']);unset($_REQUEST['end']);
}
$map['test.promote_id'] = get_pid();
//
$res = D("test_resource")->getResourceCout($map,$page,$row);
// dump($res);

@ -47,7 +47,7 @@ class TestResourceModel extends Model{
if(empty($res)){
return $res;
}
$rescount = $this
$rescount = $this->table("tab_test_resource as test")
->where($map)
->group("user_id,game_id,server_id")
->buildSql();

@ -1,13 +1,26 @@
<extend name="Public/bases" />
<block name="css">
<link href="__CSS__/20170913/news.css" rel="stylesheet"> <style> .trunk-article .article-title {padding-left:0;line-height:1.4;font-weight:bold;padding:1rem 0;} .trunk-article .article-voice {right:0;} .trunk-article .article-content img {max-width:100%;} </style>
<link href="__CSS__/20170913/news.css" rel="stylesheet"> <style>
.trunk-article .article-title {padding-left:0;line-height:1.4;font-weight:bold;padding:1rem 0;}
.trunk-article .article-voice {right:0;}
.trunk-article .article-content img {max-width:100%;}
.header .nav { display: none }
.backDiv {position: relative;bottom: 55px;width: 100px;height: 35px;text-align: center;background: #fff;border-radius: 5px;}
.backA {line-height: 35px;font-size: 12px;color: #2bd8ed;width:100%;display: block}
</style>
</block>
<block name="body">
<div class="banner">
<div class="inner"></div>
</div>
<div class="page-detail article-detail-detail">
<div class="inner clearfix">
<div class="backDiv">
<a class="backA" href="{:U('Promote/msg_list')}">返回</a>
</div>
<div class="wrap">
<div class="trunk-article clearfix">
<div class="article-title" style="width:960px">{$info.title}</div>

@ -167,9 +167,9 @@
<else />
<volist name="today_open_server_list" id="data">
<tr>
<td><img src="{$data.icon|get_cover='path'}"></td>
<td><img src="{$data.icon|get_cover='path'}" style="width:80px"></td>
<td>{$data.game_name}</td>
<td><if condition="$data.server_version eq 0">安卓、iOS<elseif condition="$data.server_version eq 1">安卓<else />iOS</if></td>
<td><if condition="$data.server_version eq 0">安卓、iOS<elseif condition="$data.server_version eq 1"/>安卓<else />iOS</if></td>
<td>{$data.start_time|date="m-d H:i",###}</td>
<td>{$data.server_name}</td>
</tr>
@ -222,7 +222,7 @@
$.each(result.data, function (index, item) {
if(index==0){
show="<tr>" +
"<td><img src='"+item.icon+"'></td>" +
"<td><img src='"+item.icon+"' style='width:80px'></td>" +
"<td>"+item.game_name+"</td>" +
"<td>"+item.pay_type+"</td>" +
"<td>"+item.start_time+"</td>" +
@ -230,7 +230,7 @@
"</tr>"
}else{
show+="<tr>" +
"<td><img src='"+item.icon+"'></td>" +
"<td><img src='"+item.icon+"' style='width:80px'></td>" +
"<td>"+item.game_name+"</td>" +
"<td>"+item.pay_type+"</td>" +
"<td>"+item.start_time+"</td>" +

@ -52,7 +52,11 @@
dataType: 'JSON',
cache: false,
success: function (result) {
layer.alert(result.info,{},function (idex) {
layer.alert(result.info,{
end:function () {
location.reload()
},
},function (idex) {
parent.layer.close(idex);
if (result.status==1){
location.reload()

@ -47,8 +47,8 @@
<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>
<?php if($loginer['id'] == 1 || $loginer['parent_id'] == 1 || $loginer['grand_id'] == 1):?>
<?php $isOpenQuery = in_array($loginer['id'], [1, 84, 531]) || in_array($loginer['parent_id'], [1, 84, 531]) || in_array($loginer['grand_id'], [1, 84, 531]) ? true : false; ?>
<?php if($isOpenQuery):?>
<div class="subNav jssubNav"><i class="prev_icon icon_shujvi"></i><span>数据管理</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
@ -78,7 +78,7 @@
<!-- <a href="{:U('Apply/app_index')}" class="<if condition='CONTROLLER_NAME eq Apply and ACTION_NAME eq app_index '>active</if> ">APP列表</a>-->
<a href="{:U('Apply/gameSpecialList')}" class="<if condition='CONTROLLER_NAME eq Apply and (ACTION_NAME eq gameSpecialList or ACTION_NAME eq specialMyGameList ) '>active</if> ">专服管理</a>
<?php if($loginer['id'] == 1 || $loginer['parent_id'] == 1 || $loginer['grand_id'] == 1):?>
<?php if($isOpenQuery):?>
<a href="{:U('Apply/gameList')}" class="<if condition='CONTROLLER_NAME eq Apply and (ACTION_NAME eq gameList or ACTION_NAME eq myGameList ) '>active</if> ">混服管理</a>
<if condition="getParentPromoteId(PID) eq 0">
<a href="{:U('GameDivide/index')}" class="<if condition='CONTROLLER_NAME eq GameDivide and (ACTION_NAME eq index ) '>active</if> ">分成比例</a>
@ -88,8 +88,8 @@
<?php endif;?>
</div>
<?php if($loginer['id'] == 1 || $loginer['parent_id'] == 1 || $loginer['grand_id'] == 1):?>
<eq name="parent_id" value="0">
<?php if($isOpenQuery):?>
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>测试资源</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('TestResource/index')}" class="<if condition='CONTROLLER_NAME eq TestResource and (ACTION_NAME eq index or ACTION_NAME eq add or ACTION_NAME eq apply ) '>active</if> ">测试资源申请</a>
@ -97,7 +97,7 @@
<a href="{:U('TestResource/supportNumberList')}" class="<if condition='CONTROLLER_NAME eq TestResource and (ACTION_NAME eq supportNumberList or ACTION_NAME eq freezeSupport or ACTION_NAME eq unfreezeSupport or ACTION_NAME eq rechangePassward ) '>active</if> ">扶持号管理</a>
<a href="{:U('TestResource/protectLogList')}" class="<if condition='CONTROLLER_NAME eq TestResource and ACTION_NAME eq protectLogList '>active</if> ">日志管理</a>
</div>
</eq>
<?php endif;?>
<!--<eq name="parent_id" value="0">
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>扶持管理</span><i class="arrow_icon"></i></div>

@ -94,9 +94,11 @@
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</notempty>
<volist name=":getAllPromoteListByType(3,false,empty(I('team_leader_id'))?PID:I('team_leader_id'))" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
<if condition="$_GET['team_leader_id'] gt 0">
<volist name=":getAllPromoteListByType(3,false,empty(I('team_leader_id'))?PID:I('team_leader_id'))" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</if>
</select>
</div>
</eq>
@ -455,20 +457,17 @@
$('#team_leader_id').change(function () {
var promoteId = parseInt($(this).val());
var promoteValue = $(this).find("option:selected").text();
var html = "<option value='' selected>推广员账号</option>";
$.ajax({
url: "{:U('getChildPromoteList')}",
type: "post",
data: {promote_id:promoteId},
dataType: 'json',
success: function (data) {
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
}
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
if (data.status == 1) {
$.ajax({
url: "{:U('getChildPromoteList')}",
type: "post",
data: {promote_id:promoteId},
dataType: 'json',
success: function (data) {
var promoteData = data.data;
if (promoteData.length > 0) {
@ -476,15 +475,22 @@
html += "<option value='" + promoteData[i]['id'] + "'>" + promoteData[i]['account'] + "(" + promoteData[i]['real_name'] + ")</option>";
}
}
}
$("#promote_id").empty();
$('#promote_id').html(html);
$("#promote_id").select2();
}
});
showPromoteSelect(html);
}
});
} else {
showPromoteSelect(html);
}
});
function showPromoteSelect(html)
{
$("#promote_id").empty();
$('#promote_id').html(html);
$("#promote_id").select2();
}
$('#own').on('click', function () {
var ownId = $('#own_id').val();
var checkBox = $(this).children('i');

@ -85,9 +85,11 @@
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</notempty>
<volist name=":getAllPromoteListByType(3,false,empty(I('team_leader_id'))?PID:I('team_leader_id'))" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
<if condition="$_GET['team_leader_id'] gt 0">
<volist name=":getAllPromoteListByType(3,false,empty(I('team_leader_id'))?PID:I('team_leader_id'))" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</if>
</select>
</div>
</eq>
@ -277,20 +279,17 @@
$('#team_leader_id').change(function () {
var promoteId = parseInt($(this).val());
var promoteValue = $(this).find("option:selected").text();
var html = "<option value='' selected>推广员账号</option>";
$.ajax({
url: "{:U('getChildPromoteList')}",
type: "post",
data: {promote_id:promoteId},
dataType: 'json',
success: function (data) {
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
}
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
if (data.status == 1) {
$.ajax({
url: "{:U('getChildPromoteList')}",
type: "post",
data: {promote_id:promoteId},
dataType: 'json',
success: function (data) {
var promoteData = data.data;
if (promoteData.length > 0) {
@ -298,15 +297,22 @@
html += "<option value='" + promoteData[i]['id'] + "'>" + promoteData[i]['account'] + "(" + promoteData[i]['real_name'] + ")</option>";
}
}
}
$("#promote_id").empty();
$('#promote_id').html(html);
$("#promote_id").select2();
}
});
showPromoteSelect(html);
}
});
} else {
showPromoteSelect(html);
}
});
function showPromoteSelect(html)
{
$("#promote_id").empty();
$('#promote_id').html(html);
$("#promote_id").select2();
}
$('#own').on('click',function () {
var ownId = $('#own_id').val();
var checkBox = $(this).children('i');

@ -56,9 +56,11 @@
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</notempty>
<volist name=":getAllPromoteListByType(3,false,empty(I('team_leader_id'))?PID:I('team_leader_id'))" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
<if condition="$_GET['team_leader_id'] gt 0">
<volist name=":getAllPromoteListByType(3,false,empty(I('team_leader_id'))?PID:I('team_leader_id'))" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</if>
</select>
</div>
</eq>
@ -186,20 +188,17 @@
$('#team_leader_id').change(function () {
var promoteId = parseInt($(this).val());
var promoteValue = $(this).find("option:selected").text();
var html = "<option value='' selected>推广员账号</option>";
$.ajax({
url: "{:U('getChildPromoteList')}",
type: "post",
data: {promote_id:promoteId},
dataType: 'json',
success: function (data) {
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
}
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
if (data.status == 1) {
$.ajax({
url: "{:U('getChildPromoteList')}",
type: "post",
data: {promote_id:promoteId},
dataType: 'json',
success: function (data) {
var promoteData = data.data;
if (promoteData.length > 0) {
@ -207,15 +206,22 @@
html += "<option value='" + promoteData[i]['id'] + "'>" + promoteData[i]['account'] + "(" + promoteData[i]['real_name'] + ")</option>";
}
}
}
$("#promote_id").empty();
$('#promote_id').html(html);
$("#promote_id").select2();
}
});
showPromoteSelect(html);
}
});
} else {
showPromoteSelect(html);
}
});
function showPromoteSelect(html)
{
$("#promote_id").empty();
$('#promote_id').html(html);
$("#promote_id").select2();
}
$('#own').on('click',function () {
var ownId = $('#own_id').val();
var checkBox = $(this).children('i');

@ -84,9 +84,11 @@
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</notempty>
<volist name=":getAllPromoteListByType(3,false,empty(I('team_leader_id'))?PID:I('team_leader_id'))" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
<if condition="$_GET['team_leader_id'] gt 0">
<volist name=":getAllPromoteListByType(3,false,empty(I('team_leader_id'))?PID:I('team_leader_id'))" id="vo">
<option value="{$vo.id}">{$vo['account']}({$vo['real_name']})</option>
</volist>
</if>
</select>
</div>
</eq>
@ -240,22 +242,19 @@
setValue('row', '{:I("get.row",10)}');
$('#team_leader_id').change(function () {
var promoteId = parseInt($(this).val());
var promoteValue = $(this).find("option:selected").text();
$.ajax({
url: "{:U('getChildPromoteList')}",
type: "post",
data: {promote_id:promoteId},
dataType: 'json',
success: function (data) {
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
}
if (data.status == 1) {
var promoteId = parseInt($(this).val());
var promoteValue = $(this).find("option:selected").text();
var html = "<option value='' selected>推广员账号</option>";
if (promoteId > 0) {
html += "<option value='" + promoteId + "'>" + promoteValue + "</option>";
$.ajax({
url: "{:U('getChildPromoteList')}",
type: "post",
data: {promote_id:promoteId},
dataType: 'json',
success: function (data) {
var promoteData = data.data;
if (promoteData.length > 0) {
@ -263,15 +262,22 @@
html += "<option value='" + promoteData[i]['id'] + "'>" + promoteData[i]['account'] + "(" + promoteData[i]['real_name'] + ")</option>";
}
}
}
$("#promote_id").empty();
$('#promote_id').html(html);
$("#promote_id").select2();
}
});
showPromoteSelect(html);
}
});
} else {
showPromoteSelect(html);
}
});
function showPromoteSelect(html)
{
$("#promote_id").empty();
$('#promote_id').html(html);
$("#promote_id").select2();
}
$('#own').on('click',function () {
var ownId = $('#own_id').val();
var checkBox = $(this).children('i');

@ -1,5 +1,7 @@
<?php
namespace Mobile\Controller;
use Org\Ipa365SDK\Ipa365;
use Org\WeixinSDK\Weixin;
use User\Api\MemberApi;
class SsgController extends BaseController {
@ -17,6 +19,7 @@ class SsgController extends BaseController {
const CODE_ERROR = -97; //验证码错误
const RETURN_SUCCESS = 1;
const RETURN_FALSE = 2;
const signprice = 10; //充值金额
public function login()
@ -27,15 +30,13 @@ class SsgController extends BaseController {
redirect(U("ssg/index", array('promete_id' => $promoteId)));
}
// /*if (!$promoteId) {
// echo "链接失效,请重新向推广员索取链接。";
// exit();
// $this->error("参数非法");
// }*/
if ($promoteId) {
$exists = M("promote", "tab_")->where(array('id' => $promoteId))->find();
if (!$exists) {
$this->error("链接失效,请重新向推广员索取链接.");
//$this->error("链接失效,请重新向推广员索取链接.");
$this->assign("error","链接失效,请重新向推广员索取链接.");
$this->display('blank');
exit();
}
}
//获取客服qq
@ -60,8 +61,9 @@ class SsgController extends BaseController {
public function do_login()
{
$account = I("Account");
$password = I("Password");
$password = I("Password");
$promoteId = I("promote_id", 0);
$password = base64_decode($password);
/*if (!$promoteId) {
$this->ajaxReturn(array("ErrorCode" => -97, "ResultMsg" => "参数非法"));
}*/
@ -72,8 +74,7 @@ class SsgController extends BaseController {
$this->ajaxReturn(array("ErrorCode" => -97, "ResultMsg" => "参数非法."));
}
}
//var_dump($password);
$verify = new \Think\Verify();
if (!$verify->check(I("VerifyCode"))) {
$this->ajaxReturn(array("ErrorCode" => -97, "ResultMsg" => "验证码错误"));
@ -100,7 +101,7 @@ class SsgController extends BaseController {
}
if($user_id>0){
$_SESSION['user_id'] = $user_id;
$user = M('user', 'tab_')->where(array(
'id' => $user_id
))->find();
@ -135,12 +136,12 @@ class SsgController extends BaseController {
$verify = new \Think\Verify($config);
$verify->codeSet = '0123456789';
$verify->entry($vid);
}
//注册
public function phoneRegister()
{
{
//添加用户
C(api('Config/lists'));
@ -152,7 +153,7 @@ class SsgController extends BaseController {
}
#验证短信验证码
$this -> sms_verify($user['account'], $user['code']);
$res = $this -> doRegister($user['account'],$user['password'],$user['account'],$promoteId,4,2);
if(empty($res)){
$this -> set_message(1017, "fail", "添加失败");
@ -160,10 +161,37 @@ class SsgController extends BaseController {
//添加自动登录
$userApi = new MemberApi();
$user_id = $userApi->login($user['account'], $user['password'],1);
$this -> set_message(1, "success", "添加成功");
}
//忘记密码
public function forgetPassword()
{
$user = $_POST;
if (empty($user)) {
$this -> set_message(1001, "fail", "基础信息不能为空");
}
$this -> sms_verify($user['account'], $user['code']);
//更新密码
$userApi = new MemberApi();
$userInfo = M("user","tab_")->where("account = '".$user['account']."'")->find();
if(empty($userInfo)){
$this -> set_message(1003, "fail", "用户不存在");
}
//更新用户
$upres = $userApi->updatePassword($userInfo['id'], $user['password']);
if($upres){
//自动登陆
$user_id = $userApi->login($user['account'], $user['password'],1);
$this -> set_message(0, "success", "修改成功");
}else{
$this -> set_message(1005, "fail", "密码更新错误,请刷新后再次尝试");
}
# code...
}
//普通注册
public function userRegister()
{
@ -175,7 +203,7 @@ class SsgController extends BaseController {
$this -> set_message(1017, "fail", "添加失败");
}
//添加自动登录
$userApi = new MemberApi();
$user_id = $userApi->login($account, $password,1);
@ -240,7 +268,6 @@ class SsgController extends BaseController {
redirect(U("ssg/login"));
//$this->error("请登入", U('ssg/login'));
}
$appqq = M("config", "sys_")->field('value')->where("name='APP_QQ'")->find()['value'];
$this->assign("app_qq", $appqq);
$this->display();
@ -258,7 +285,7 @@ class SsgController extends BaseController {
$map["sdk_version"]=2;
$map["game_status"]=1;
$game_list = M("game", "tab_")->field("*, id as game_id")->where($map)->select();
for ($i=0; $i < count($game_list); $i++) {
for ($i=0; $i < count($game_list); $i++) {
$game_list[$i]["game_icon"] = get_cover($game_list[$i]["icon"], 'path');
}
$res = array("list"=>$game_list);
@ -270,7 +297,7 @@ class SsgController extends BaseController {
$userpay = [];
}else{
$tmparr = [];
for ($i=0; $i < count($userpay); $i++) {
for ($i=0; $i < count($userpay); $i++) {
# code...
$tmparr[] = $userpay[$i]["game_id"];
}
@ -329,10 +356,6 @@ class SsgController extends BaseController {
$this->display();
}
public function clear(){
\Think\Log::record('缓存清理业务触发');
session(null);
}
//退出
public function logout() {
session("user_auth",null);
@ -403,23 +426,387 @@ class SsgController extends BaseController {
}
}
/**
* 领取激活码
* @param $token
* @param $gift_id
* author: xmy 280564871@qq.com
*支付中心
*/
public function get_novice($user_id,$gift_id){
$model = D("Giftbag");
$exist = $model->checkAccountGiftExist($logininfo['user_id'],$gift_id);
if($exist){
$this->error("您已经领取过该礼包!");
}
$novice = $model->getNovice($logininfo['user_id'],$logininfo['account'],$gift_id);
if(empty($novice)){
$this->error("暂无激活码");
}
$this->success("领取成功",$novice);
public function pay(){
$user = session("user_auth");
$gameId = I("game_id", 0);
//$price = self::signprice;
if (!$user) {
redirect("/mobile.php/ssg/login");
// $this->error("请登入", "/mobile.php/ssg/login");
}
$userId = $user['user_id'];
$gameInfo = M('game', 'tab_')->field('game_name,supersign_token')->where(array(
'id' => $gameId,
))->find();
$payLog = M('game_supersign', 'tab_')->where(array(
'user_id' => $userId,
'game_id' => $gameId
))->find();
if($payLog && $payLog['pay_status']==1){
//$this->assign("error","亲~您已购买过了~<br/>请到【订单查询】查看订单信息哟~");
//$this->display('blank');
redirect("/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/".$payLog['order_id']);
}else{
if (!$gameInfo['supersign_token']) {
//$this->error("超级签token未填写");
$this->assign("error","超级签token未配置~");
$this->display('blank');
exit();
}
$this->assign("price", self::signprice);
//$this->assign("order_id", $orderId);
$this->assign("game_id",$gameId);
$this->assign("game_name",$gameInfo['game_name']);
$this->display('pay');
}
}
/*
* 发起支付
*/
public function dopay() {
$user = session("user_auth");
if (!$user ) {
//redirect("/mobile.php/ssg/login");
redirect(U("ssg/login"));
}
$gameId = I("game_id", 0);
$paytype = I("pay_type", 'ali');
$price = self::signprice;
$userId = $user['user_id'];
if (!$userId || !$gameId) {
//$this->error("参数有误!");
$this->assign("error","参数有误~");
$this->display('blank');
exit();
}
$payLog = M('game_supersign', 'tab_')->where(array(
'user_id' => $userId,
'game_id' => $gameId
))->find();
$gameInfo = M('game', 'tab_')->field('game_name,supersign_token')->where(array(
'id' => $gameId,
))->find();
if ($payLog && $payLog['pay_status']==0) {
$orderId = $payLog['order_id'];
}elseif ($payLog && $payLog['pay_status']==1){
/*$orderId = $payLog['order_id'];
if(stripos($_SERVER['HTTP_HOST'], '.wmtxkj.cn') || $_SERVER['HTTP_HOST']=='127.0.0.1' || stripos($_SERVER['HTTP_HOST'], '.free.idcfengye.com')){
redirect("http://".$_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/$orderId");
}else{
redirect("https://".$_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/$orderId");
}*/
$this->assign("error","亲~您已购买过了~<br/>请到【订单查询】查看订单信息哟~");
$this->display('blank');
//$this->error("亲~您已购买过了~请到【订单查询】查看订单信息哟~");
exit();
} else {
$orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签
if (!$gameInfo['supersign_token']) {
//$this->error("超级签token未填写");
$this->assign("error","超级签token未配置~");
$this->display('blank');
exit();
}
$r = M('game_supersign', 'tab_')->add(array(
'udid' => '',
'user_id' => $userId,
'game_id' => $gameId,
'order_id' => $orderId,
'pay_price' => $price,
'pay_status' => 0,
'ticket' => '', // 调用安装的时候分配
'token' => $gameInfo['supersign_token'],
'create_time' => time()
));
if (!$r) return -1;
}
if($paytype=='ali'){
$param['price'] = $price;
$param['sdk_version'] = '2';
$param['user_id'] = $userId;
$param['game_id'] = $gameId;
$param['order_id'] = $orderId;
$param['apitype'] = "alipay";
$param['config'] = "alipay";
$param['signtype']= "MD5";
$param['server'] = "alipay.wap.create.direct.pay.by.user";
$param['payway'] = 1;
$param['title'] = $price;
$param['body'] = $price;
//$param['callback'] = "https://m.wmtxkj.com/mobile.php/Ssg/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
//$param['notifyurl'] = "https://m.wmtxkj.com/callback.php/Notify/notify/apitype/alipay";
if(stripos($_SERVER['HTTP_HOST'], '.wmtxkj.cn') || $_SERVER['HTTP_HOST']=='127.0.0.1' || stripos($_SERVER['HTTP_HOST'], '.free.idcfengye.com')){
$param['callback'] = "http://".$_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "http://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
}else{
$param['callback'] = "https://".$_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
}
$ali_pay = $this->alipay($param);
redirect($ali_pay['url']);
}else{
$weixn = new Weixin();
$wx_pay = json_decode($weixn->weixin_pay('超级签消费', $orderId, $price, 'MWEB', 4), true);
if($wx_pay['status']==1){
//$redirect_url = $_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
redirect($wx_pay['mweb_url']);
}else{
$this->assign("error",$wx_pay['return_msg']);
$this->display('blank');
}
}
}
// alipay
public function alipay($param) {
$pay = new \Think\Pay($param['apitype'],C($param['config']));
$vo = new \Think\Pay\PayVo();
$vo->setBody("超级签消费")
->setFee($param['price'])//支付金额
->setTitle($param['title'])
->setOrderNo($param['order_id'])
->setService($param['server'])
->setSignType($param['signtype'])
->setPayMethod("wap")
->setTable("supersign")
->setPayWay($param['payway'])
->setCallback($param['callback'])
->setNotifyUrl($param['notifyurl'])
->setGameName(get_game_name($param['game_id']))
->setServerId(0)
->setUserId($param['user_id'])
->setSdkVersion($param['sdk_version']);
$pay_['url']= $pay->buildRequestForm($vo);
//$pay_['out_trade_no']= $out_trade_no;
return $pay_;
}
/**
* 用户点击安装
*/
public function install() {
$user = session("user_auth");
if (!$user ) {
//$this->error("请登入", "/mobile.php/ssg/login");
redirect(U("ssg/login"));
}
$userId = $user['user_id'];
$gameId = I('game_id', 0);
$orderId = I('order_id', 0);
if (!$userId || !$gameId || !$orderId) {
//$this->error("参数有误!");
$this->assign("error","参数有误~");
$this->display('blank');
exit();
}
M()->startTrans();
// 获取支付记录
$gamesign = M('game_supersign', 'tab_')->where(array(
'order_id' => $orderId,
'user_id' => $userId,
'game_id' => $gameId,
'pay_status' => 1,
))->find();
if (!$gamesign) {
//$this->error("支付记录不存在");
$this->assign("error","支付记录不存在~");
$this->display('blank');
exit();
}
if ($gamesign['url']) {
redirect($gamesign['url']);
}
$token = $gamesign['token'];
$ipa365 = new Ipa365();
$i = 1;
while (1) {
// 获取授权码
$list = $ipa365->ticketList(array(
'token' => $token,
'limit' => $i,
)); // @todo: 并发授权码已分配的情况
$code = $list['data']['list'][$i-1]['code'];
$codeExists = M('game_supersign', 'tab_')->field('id')->where(array(
'ticket' => $code,
))->find();
if (!$codeExists) {
break;
}
$i ++;
}
$game = M('game', 'tab_')->where(array(
'id' => $gameId,
))->find();
$url = $game['supersign_url']."?code={$code}";
$r = M('game_supersign', 'tab_')->where(array(
'user_id' => $userId,
'game_id' => $gameId,
'pay_status' => 1
))->save(array(
'ticket' => $code, // 调用安装的时候分配
'url' => $url,
));
if (!$r) {
pp(M('game_supersign', 'tab_')->_sql());
M()->rollback();
return -1;
}
M()->commit();
redirect($url);
}
/**
* 下载页面 判断订单是否支付成功
*/
public function install_show() {
$orderId = I('order_id', 0);
$gameId = I('game_id', 0);
$user = session("user_auth");
if (!$user ) {
//$this->error("请登入", "/mobile.php/ssg/login");
redirect(U("ssg/login"));
}
$userId = $user['user_id'];
if (!$userId ) {
//$this->error("请登入", "/mobile.php/ssg/login");
redirect(U("ssg/login"));
}
if (!$orderId || !$gameId || !$userId) {
//$this->error("参数校验失败,请重试");
$this->assign("error","参数校验失败,请重试~");
$this->display('blank');
exit();
}
$supersign = M('game_supersign', 'tab_')->where(array('order_id' => $orderId,"game_id"=>$gameId))->find();
if (!$supersign) {
//$this->error("订单不存在");
$this->assign("error","订单不存在");
$this->display('blank');
exit();
}
if ($supersign['pay_status'] != 1) {
//$this->error("订单未支付");
$this->assign("error","订单未支付");
$this->display('blank');
exit();
}
$game = M('game', 'tab_')->where(array('id' => $gameId))->find();
$this->assign('game', $game);
$this->assign('url', U('Ssg/install', array(
'order_id' => $orderId,
'user_id' => $userId,
'game_id' => $gameId
)));
//获取礼包码
$giftbag = M('giftbag', 'tab_')->field("*")->where(array("game_id"=>$gameId,"giftbag_version"=>3))->find();
if(empty($giftbag)){
$giftbag = false;
}else{
$desribe = $giftbag['desribe'];
$mygif = $this->checkAccountGiftExist($userId,$giftbag['id']);
if(!empty($mygif)){
//已经领取
$giftbag =$mygif;
}else{
if($giftbag['novice_num']>0){
//领取
$giftbag = $this->getNovice($userId,$user['account'],$giftbag['id']);
}
}
$giftbag['desribe'] = $desribe;
}
//验证是否领取
$this->assign('giftbag', $giftbag);
$this->display();
}
/*
* 打包列表
*/
public function pay_list() {
$user = session("user_auth");
if (!$user ) {
//$this->error("请登入", "/mobile.php/ssg/login");
redirect(U("ssg/login"));
}
$userId = $user['user_id'];
$list = M('game_supersion', 'tab_')->where(array(
'user_id' => $userId,
))->select();
$this->assign("list", $list);
$this->display();
}
//领取礼包码
public function getNovice($user_id,$account,$gift_id){
$data =M("giftbag",'tab_')->find($gift_id);
$novice_str = $data['novice'];
$novice_arr = str2arr($novice_str,",");
if (empty($novice_arr)){
return "";
}
$novice_arr = array_filter($novice_arr);
$novice = array_pop($novice_arr);
$data['novice_num'] = count($novice_arr);
$data['novice'] = arr2str($novice_arr,",");
M("giftbag",'tab_')->startTrans();
$novice_result = M("giftbag",'tab_')->save($data);
if(!empty($novice)){
//记录领取
$record['game_id'] = $data['game_id'];
$record['game_name'] = $data['game_name'];//get_game_name($data['game_id']);
$record['gift_id'] = $gift_id;
$record['gift_name'] = $data['giftbag_name'];
$record['status'] = 0;
$record['novice'] = $novice;
$record['user_id'] = $user_id;
$record['user_account'] = $account;
$record['create_time'] = time();
$record['start_time'] = $data['start_time'];
$record['end_time'] = $data['end_time'];
$record_result = M("gift_record",'tab_')->add($record);
}else{
$novice_result = false;
}
if($novice_result === false || $record_result === false){
M("giftbag",'tab_')->rollback();
return "";
}else{
M("giftbag",'tab_')->commit();
return $record;
}
}
public function checkAccountGiftExist($user_id,$gift_id){
$map['user_id'] = $user_id;
$map['gift_id'] = $gift_id;
return M("gift_record",'tab_')->field('*')->where($map)->find();
}
}

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1, maximum-scale=1, user-scalable=no">
<title>错误信息</title>
<link href="__CSS__/ssg/common.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="blank-box">
<div class="title">
<img class="gologin" src="__IMG__/ssg/alipay/back.png" onclick="javascript:history.go(-1)">
<div class="content">错误信息</div>
<div class="titleright"></div>
</div>
<div class="cell-box">
<img src="__IMG__/ssg/error.png">
</div>
<p>{$error}</p>
<!--<div class="resbtn">
<a href="#">
刷新页面
</a>
</div>-->
</div>
</body>
<script src="__JS__/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="__JS__/ssg/common.js" type="text/javascript"></script>
<script>
</script>
</html>

@ -6,7 +6,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>超级签购买界面</title>
<title>超级签首页</title>
<link href="__CSS__/ssg/common.css" rel="stylesheet" type="text/css">
<script src="__JS__/ssg/flexible.min.js" type="text/javascript"></script>
<script src="__JS__/ssg/juicer.min.js" type="text/javascript"></script>
@ -134,7 +134,7 @@ var index = {
getgamelist(){
$.ajax({
type: 'POST',
url: 'mobile.php?s=/Ssg/getGamaList.html',
url: 'mobile.php/Ssg/getGamaList.html',
dataType: 'JSON',
data:index.select,
success: function (result) {
@ -181,11 +181,11 @@ $(".pay-button").on("click",function(){
if(inres > -1){
alert("亲~您已购买过了~请到【订单查询】查看订单信息哟~");
}else{
location.href = "/sdk.php/Ipa365/pay/game_id/"+index.choose.game_id;
location.href = "mobile.php/Ssg/pay/game_id/"+index.choose.game_id;
}
})
$("#logout").on("click",function(){
location.href = "mobile.php?s=/Ssg/logout.html";
location.href = "mobile.php/Ssg/logout.html";
})
function throttle(fun, delay) {

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>订单详情</title>
<link href="__CSS__/ssg/common.css" rel="stylesheet" type="text/css">
<script src="/Public/Mobile/js/ssg/flexible.min.js" type="text/javascript"></script>
</head>
<body class="install-box">
<div class="title" >
<img class="gologin" src="__IMG__/ssg/alipay/back.png" style="margin-left:.24rem;" onclick="javascript:history.go(-1)">
<div style="font-size: .32rem;color: #fff;">{$game['game_name']}</div>
<div class="titleright" style="margin-right:.24rem;"></div>
</div>
<div class="page-container ">
<div class="vip-download">
<div class="game-info" style="padding: .3rem;width: 6.9rem;height: 3.4rem;font-size: .28rem;margin: auto;">
<img src="__IMG__/ssg/detail/download-bg.png">
<div class="game-icon" style="top:.5rem;"><img src="{$game['icon']|get_cover='path'}"></div>
<div class="game-title">{$game['game_name']}-超级签</div>
<div class="game-rule">不同设备需要分别付费安装哦,请使用常用设备下载</div>
<div class="download-button"><a href="{$url}">下载安装</a></div>
</div>
<if condition="$giftbag">
<div style="padding:0 .3rem;">
<div class="game-gift shaddowbox">
<div class="title-3">
<h2>特权礼包</h2>
</div>
<div class="gift-list">
<ul>
<li >
<div class="gift-title">
<h2>{$giftbag['gift_name']}</h2>
</div>
<p class="gift-info">{$giftbag['desribe']}</p>
<p class="gift-code">
<label for="giftCode">兑换码:</label>
<input id="giftCode1455" type="text" value="{$giftbag['novice']}" readonly="">
<a href="javascript:;" class="code-btn1455" data-clipboard-target="#giftCode1455">复制兑换码</a>
</p>
</li>
</ul>
</div>
</div>
</div>
</if>
</div>
</div>
<script src="__JS__/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="__JS__/ssg/clipboard.min.js" type="text/javascript"></script>
</body>
<script>
var clipboard = new ClipboardJS(".code-btn1455");
clipboard.on('success', function (e) {
alert("复制成功");
});
clipboard.on('error', function (e) {
var ua = navigator.userAgent;
var isIOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if (isIOS && ua.match(/os\s+(\d+)/i)[1] - 0 < 10) {
alert("您的系统版本过低,请手动复制下方地址");
}
});
</script>
</html>

@ -17,7 +17,7 @@
<!---登陆弹框-->
<div id="alert_box" style="height: 100vh;background:rgba(41,41,41,.8);position:fixed;z-index:9999;top: 0px;width: 100%;display: none;">
<div style="top:50%;margin-top: -1.5rem;position: fixed;width: 6.3rem;left: 50%;margin-left: -3.2rem;background-color: #fff;border-radius:.2rem;">
<div style="line-height:1.4rem;font-size:.32rem;text-align: center;">
<div id="alert_content" style="line-height:1.4rem;font-size:.32rem;text-align: center;">
注册成功,三秒后将自动登陆。
</div>
<a onclick="hideAndLogin()" href="javascript:" style="line-height:1rem;font-size:.32rem;text-align: center;color: #21B1EB;width: 100%;display: block;border-top: 1px solid #f5f5f5;">
@ -68,9 +68,17 @@
</div>
</div>
<div class="login-footer">
<img src="__IMG__/ssg/login/kf.png">
<div class="chatqq">
联系客服
<div class="login-footer">
<img src="__IMG__/ssg/login/forget.png">
<div class="forget content">
忘记密码
</div>
</div>
<div class="login-footer">
<img src="__IMG__/ssg/login/kf.png">
<div class="chatqq content">
联系客服
</div>
</div>
</div>
</div>
@ -89,7 +97,7 @@
</div>
<div class="formitem">
<img src="__IMG__/ssg/login/password.png">
<input id="phonepassword" type="password" placeholder="请输入6-12位字母组合密码" value="">
<input id="phonepassword" type="password" placeholder="请输入6-12位字母组合密码" value="">
</div>
<div class="formitem" style="border: 0px;">
<div class="formitem" style="margin-right: .2rem;margin-top: 0px;width: 3.5rem;">
@ -115,9 +123,7 @@
</div>
</div>
</div>
</div>
</div>
<div class="swiper-slide swiper-no-swiping">
<!--普通注册-->
@ -133,7 +139,7 @@
</div>
<div class="formitem">
<img src="__IMG__/ssg/login/password.png">
<input id="regpassword" type="password" placeholder="请输入6-12位字母组合密码" value="">
<input id="regpassword" type="password" placeholder="请输入6-12位字母组合密码" value="">
</div>
<div class="formitem">
<img src="__IMG__/ssg/login/password.png">
@ -155,20 +161,136 @@
</div>
</div>
</div>
</div>
</div>
<div class="swiper-slide swiper-no-swiping">
<!--忘记密码-->
<div class="loginbox">
<div class="title">
<img class="gologin" src="__IMG__/ssg/login/back.png">
<div>忘记密码</div>
<div class="titleright"></div>
</div>
<div class="formitem" style="margin-top: 0px;">
<img src="__IMG__/ssg/login/phone.png">
<input id="forgetPhoneval" type="text" placeholder="请输入手机号" value="">
</div>
<div class="formitem">
<img src="__IMG__/ssg/login/password.png">
<input id="forgetPhonepassword" type="password" placeholder="请输入新密码" value="">
</div>
<div class="formitem" style="border: 0px;">
<div class="formitem" style="margin-right: .2rem;margin-top: 0px;width: 3.5rem;">
<img src="__IMG__/ssg/login/code.png">
<input id="forgetPhonecode" type="text" placeholder="请输入短信验证码" value="" style="width:2.5rem;">
</div>
<div id="forgetGetPhoneCode" class="phonecodebtn">
获取验证码
</div>
</div>
<!---按钮-->
<div id="forgetBtn" class="login-btn-group">
<div class="login-btn-big" style="background: url('__IMG__/ssg/login/bigbuttonbg.png') no-repeat top center/cover;">
确定
</div>
</div>
<div class="reg-footer">
<div style="max-width:3.2rem;font-size: .20rem;"><i style="color: red;margin-right: 5px;">*</i>未绑定手机号的用户请联系客服:<br/><span style="margin-left: 10px;">在线客服:{$app_qq}</span></div>
<div class="reg-change">
<img src="__IMG__/ssg/login/kf.png">
<div class="chatqq">
联系客服
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script src="__JS__/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="__JS__/swiper.min.js" type="text/javascript"></script>
<script src="__JS__/ssg/base64.min.js" type="text/javascript"></script>
<script>
var PhoneObj = {
i:60,
codeflag:true,
//验证手机
checkPhone:function(phone){
if(!(/^1[3456789]\d{9}$/.test(phone))){
alert("手机号码有误,请重填");
return false;
} else{
return true;
}
},
//倒计时
countDown:function(dom){
PhoneObj.codeflag = false;
PhoneObj.i = PhoneObj.i - 1;
$("#getPhoneCode").html(PhoneObj.i+"秒后重发").css("backgroundColor","#f5f5f5").css("color","#A9A9A9");
$("#forgetGetPhoneCode").html(PhoneObj.i+"秒后重发").css("backgroundColor","#f5f5f5").css("color","#A9A9A9");
if (PhoneObj.i == 0) {
$("#getPhoneCode").html("重新发送").css("backgroundColor","#21B1EB").css("color","#fff");
$("#forgetGetPhoneCode").html("重新发送").css("backgroundColor","#21B1EB").css("color","#fff");
PhoneObj.codeflag = true;
PhoneObj.i = 60;
return;
}
setTimeout(function(){
PhoneObj.countDown(dom)
},1000);
},
//获取验证码
sendPhoneCode:function(phone,fun){
if(PhoneObj.codeflag){
if(PhoneObj.checkPhone(phone)){
//无需等待网络响应直接倒计时
fun()
//获取验证码
$.ajax({
type: 'GET',
url: 'mobile.php?s=/Ssg/sendPhoneCode.html&phone='+phone,
dataType: 'JSON',
success: function (result) {
if (result.status != 1) {
alert(result.msg);
}
}
})
}
}else{
// alert("发送验证码频率过高,请等待"+PhoneObj.i+"秒后再试")
}
},
checkPassword(password){
console.log(password);
if(password.length < 6 || password.length > 15){
alert('密码长度6-15个字符');
return false;
}
var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])');
if (!pwdRegex.test(password)) {
alert("您的密码复杂度太低(密码中必须包含字母、数字)!");
return false;
}
var chinaRex = new RegExp("[\\u4E00-\\u9FFF]+","g");;
if (chinaRex.test(password)) {
alert("密码不允许含有中文字符!");
return false;
}
return true;
}
}
</script>
<script type="text/javascript">
var mySwiper = new Swiper('.swiper-container', {
// autoplay: true,//可选选项,自动滑动
// initialSlide :2,
// initialSlide :3,
// effect : 'fade',
noSwiping : true,
})
checkSafari()
@ -189,12 +311,14 @@
mySwiper.slideTo(0, 350, false);
})
$(".back").on("click",function(){
window.location.href='{:U("home")}';
window.location.href='{:U("home"),"&promote_id=".$promote_id}';
})
$(".chatqq").on("click",function(){
window.location.href = 'mqqwpa://im/chat?chat_type=wpa&uin={$app_qq}&version=1&src_type=web&web_src=oicqzone.com';
})
$(".forget").on("click",function(){
mySwiper.slideTo(3, 500, false);
})
//获取验证码
@ -225,7 +349,7 @@
url: 'mobile.php?s=/Ssg/do_login.html',
data: {
'Account': loginName,
'Password': (loginPass),
'Password': window.btoa(loginPass),
'VerifyCode': userCode,
'promote_id': promoteId,
},
@ -245,28 +369,18 @@
}
});
})
//倒计时
var codeflag = true;
//手机注册按钮
$("#phonereg").on("click",function(){
var phone = $('#phoneval').val();
var phonepassword = $('#phonepassword').val();
var phonecode = $('#phonecode').val();
var promoteId = $("#promote_id").val();
if(!checkPhone(phone)){
if(!PhoneObj.checkPhone(phone)){
return false;
}
if(phonepassword.length < 6 || phonepassword.length > 15){
alert('密码长度6-15个字符');
if(!PhoneObj.checkPassword(phonepassword)){
return false;
}
var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z]).{8,30}');
if (!pwdRegex.test(phonepassword)) {
alert("您的密码复杂度太低(密码中必须包含字母、数字)!");
return false;
}
if(phonecode == ''){
alert('请输入验证码');
return false;
@ -288,9 +402,6 @@
} else {
$("#alert_box").show();
setTimeout(hideAndLogin,2500)
//成功
// alert("注册成功,三秒后将自动登陆");
// window.location.href = "mobile.php?s=/Ssg/index.html"
}
}
})
@ -303,42 +414,20 @@
//获取手机验证码
$("#getPhoneCode").on("click",function(){
//获取手机
var dom = $(this);
var phone = $('#phoneval').val();
if(codeflag){
if(checkPhone(phone)){
//获取验证码
$.ajax({
type: 'GET',
url: 'mobile.php?s=/Ssg/sendPhoneCode.html&phone='+phone,
dataType: 'JSON',
success: function (result) {
console.log(result)
if (result.status != 1) {
alert(result.msg);
} else {
countDown();
}
}
})
}
}
})
var i = 60;
function countDown() {
codeflag = false;
i = i - 1;
$("#getPhoneCode").html(i+"秒后重发").css("backgroundColor","#f5f5f5").css("color","#A9A9A9");
if (i == 0) {
$("#getPhoneCode").html("重新发送").css("backgroundColor","#21B1EB").css("color","#fff");
codeflag = true;
i = 60;
return;
}
setTimeout('countDown()',1000);
}
PhoneObj.sendPhoneCode(phone,function(){
PhoneObj.countDown(dom);
});
})
$("#forgetGetPhoneCode").on("click",function(){
//获取手机
var dom = $(this);
var phone = $('#forgetPhoneval').val();
PhoneObj.sendPhoneCode(phone,function(){
PhoneObj.countDown(dom);
});
})
//普通注册
$("#userreg").on("click",function(){
var account = $('#regaccount').val();
@ -354,13 +443,7 @@
alert("账号必须是6-12位字母数字组合");
return false;
}
if(regpassword.length < 6 || regpassword.length > 15){
alert('密码长度6-15个字符');
return false;
}
if (!pwdRegex.test(regpassword)) {
alert("您的密码复杂度太低(密码中必须包含字母、数字)!");
if(!PhoneObj.checkPassword(regpassword)){
return false;
}
if(regpassword != regpassword2){
@ -391,15 +474,42 @@
})
})
//验证手机
function checkPhone(phone){
if(!(/^1[3456789]\d{9}$/.test(phone))){
alert("手机号码有误,请重填");
return false;
} else{
return true;
//忘记密码
$("#forgetBtn").on("click",function(){
var phone = $('#forgetPhoneval').val();
var phonepassword = $('#forgetPhonepassword').val();
var phonecode = $('#forgetPhonecode').val();
if(!PhoneObj.checkPhone(phone)){
return false;
}
}
if(!PhoneObj.checkPassword(phonepassword)){
return false;
}
if(phonecode == ''){
alert('请输入验证码');
return false;
}
$.ajax({
type: 'POST',
url: 'mobile.php?s=/Ssg/forgetPassword.html',
dataType: 'JSON',
data:{
account:phone,
password:phonepassword,
code:phonecode
},
success: function (result) {
console.log(result)
if (result.return_code == 'fail') {
alert(result.return_msg);
} else {
$("#alert_content").html("密码修改成功,系统将在三秒后自动登录");
$("#alert_box").show();
setTimeout(hideAndLogin,2500)
}
}
})
})
function checkSafari() {
var promoteId = $("#promote_id").val();
var ua = navigator.userAgent.toLowerCase();

@ -28,7 +28,7 @@
</div>
<if condition="$data['pay_status'] eq '1'">
<a href="/sdk.php/Ipa365/install_show.html?order_id={$data.order_id}&game_id={$data['game_id']}">
<a href="/mobile.php/Ssg/install_show.html?order_id={$data.order_id}&game_id={$data['game_id']}">
<div class="flexitem gamebox">
<img src="{$data['icon']|get_cover='path'}">
<div class="gameboxname">{$data['game_name']}-超级签</div>
@ -44,7 +44,7 @@
</div>
<else />
<if condition="$data['pay_status'] eq '0' and $data['invalid'] eq 0">
<a href="/sdk.php/Ipa365/pay/game_id/{$data['game_id']}">
<a href="/mobile.php/Ssg/pay/game_id/{$data['game_id']}">
<div class="flexitem gamebox">
<img src="{$data['icon']|get_cover='path'}">
<div class="gameboxname">{$data['game_name']}-超级签</div>

@ -0,0 +1,179 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>支付中心-网上支付 安全快速!</title>
<link href="__IMG__/ssg/favicon.ico" type="image/x-icon" rel="shortcut icon">
<link href="__CSS__/ssg/pay-center.css" rel="stylesheet" type="text/css">
<link href="__CSS__/ssg/common.css" rel="stylesheet" type="text/css">
<script src="/Public/Mobile/js/ssg/flexible.min.js" type="text/javascript"></script>
<script src="__JS__/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="__JS__/jquery.base64.js" type="text/javascript"></script>
</head>
<style>
body{
min-height: 100vh;
background-color: #F5F5F5;
}
.m-order{
background-color: #F5F5F5;
}
.title{
display: flex;
height: .9rem;
width: 100%;
justify-content: space-between;
align-items: center;
background-color: #21B1EB;
}
.title img,
.titleright {
width: .3rem;
height: .3rem;
}
.order-payinfo-item{
border-top: 1px solid #f5f5f5;
}
</style>
<body>
<!-- <div class="topbar">
<div class="topcon auto">
<h1 class="pay-logo">
<img src="__IMG__/ssg/alipay/pay-logo.png" alt="Logo"></h1>
</div>
</div> -->
<div class="title" >
<img class="gologin" src="__IMG__/ssg/alipay/back.png" style="margin-left:.24rem;" onclick="javascript:history.go(-1)">
<div style="font-size: .32rem;color: #fff;">{$game_name}</div>
<div class="titleright" style="margin-right:.24rem;"></div>
</div>
<!-- 其他通道 -->
<div class="container-pay">
<div class="auto">
<div class="orders-summary">
<div class="orders-name">超级签购买</div>
<div class="orders-desc">订单描述:<span>{$order_id}</span></div>
<div class="total-money">应付金额:<strong>{$price}</strong></div>
</div>
<div class="order-checkbank">
<div class="order-checkbank-con">
<div class="order-checkbank-tit">请选择付款方式:</div>
<ul class="order-checkbank-list">
<li>
<a href="/sdk.php/Ipa365/dopay/game_id/{$game_id}/pay_type/ali"
title="支付宝">
<img src="__IMG__/ssg/alipay/zfb-icon.png" alt="支付宝">
</a>
</li>
</ul>
</div>
<div class="order-checkbank-mid">
<p class="odd">请选择支付方式。建议选择使用支付宝、微信支付、银行卡,支付请直接点击相应付款按钮。如果您使用支付宝账户支付,请点击“支付宝”按钮。</p>
<p class="odd">如果您选择支付宝、微信支付、银行卡支付时,请遵守相关支付宝、微信支付、财付通的规定进行操作。您在支付宝、微信支付、财付通页面上进行的任何操作及其产生的</p>
<p>任何法律后果,将按照您与支付宝、微信支付、银行卡之间签订的合同处理。本网站不承担任何责任。</p>
</div>
</div>
</div>
</div>
<!-- 微信回调弹框 -->
<div id="alert_box" style="height: 100vh;background:rgba(41,41,41,.8);position:fixed;z-index:9999;top: 0px;width: 100%;" hidden>
<div style="top:50%;margin-top: -1.5rem;position: fixed;width: 6.3rem;left: 50%;margin-left: -3.2rem;background-color: #fff;border-radius:.3rem;">
<img onclick="closeAlert()" src="__IMG__/ssg/alipay/close.png" style="width: .3rem;height: .3rem;position: absolute;left: .3rem;top: .3rem;">
<div style="line-height:1.4rem;font-size:.32rem;text-align: center;">
请确认微信支付是否已完成
</div>
<a href="{$callback}" style="line-height:1rem;font-size:.28rem;text-align: center;color: red;width: 100%;display: block;border-top: 1px solid #f5f5f5;border-bottom: 1px solid #f5f5f5;">
已完成支付
</a>
<a href="javascript:location.reload();" style="height:1rem;line-height:1rem;font-size:.28rem;text-align: center;color: #A9A9A9;width: 100%;display: block;">
支付遇到问题,重新支付
</a>
</div>
</div>
<!-- 触屏订单通道 -->
<div class="m-order">
<div style="padding: .3rem;">
<div style="width: 6.9rem;height: 1.7rem;background-color: #fff;border-radius:10px;margin: auto;font-size: .28rem;color:#292929;">
<div style="display: flex;height: .8rem; justify-content: space-between;align-items:center;padding: 0 .3rem;">
<div>订单名称:</div>
<div>超级签购买</div>
</div>
<div style="display: flex;height: .8rem; justify-content: space-between;align-items:center;padding: 0 .3rem;">
<div>订单金额:</div>
<div>{$price}元</div>
</div>
</div>
</div>
<div class="m-order-payinfo" style="width: 6.9rem;margin:auto;border-radius:10px;border: 0px;">
<div class="payinfo-tit" style="display: flex;justify-content: space-between;">
<label style="font-weight: normal;color:#292929;">还需支付: </label>
<span>{$price}</span>
</div>
<a class="order-payinfo-item"
href="#;" onclick="jump('/mobile.php/Ssg/dopay/game_id/{$game_id}/pay_type/ali')"
title="支付宝" style="padding: .3rem 0;width: 6.3rem;margin-left: .3rem;">
<div class="order-payinfo-icon" style="width: .7rem;height: .7rem;">
<img src="__IMG__/ssg/alipay/zfb-pic.jpg" style="width: 100%;height: 100%;border: 0px;" alt="支付宝">
</div>
<div class="order-payinfo-con" style="margin-left: .21rem;">
<div class="pay-title">支付宝支付</div>
<div class="pay-meta">推荐支付宝用户使用</div>
</div>
</a>
<a class="order-payinfo-item"
href="#;" onclick="jump('/mobile.php/Ssg/dopay/game_id/{$game_id}/pay_type/wx')"
title="微信支付" style="padding: .3rem 0;width: 6.3rem;margin-left: .3rem;">
<div class="order-payinfo-icon" style="width: .7rem;height: .7rem;">
<img src="__IMG__/ssg/alipay/wxpay.png" style="width: 100%;height: 100%;border: 0px;" alt="微信支付">
</div>
<div class="order-payinfo-con" style="margin-left: .21rem;">
<div class="pay-title">微信支付</div>
<div class="pay-meta">推荐微信用户使用</div>
</div>
</a>
</div>
</div>
<!--<div class="footer-pay">
<p>海南万盟天下科技有限公司 版权所有 ©2019 支付中心</p>
</div>-->
</body>
<script>
function jump(pay_url) {
window.location.href = pay_url;
/*if(paytype=='alipay'){
window.location.href = pay_url;
}else{
showAlert();
window.location.href = pay_url;
//window.open(pay_url,"_blank");
}*/
/*if(isWeiXin()){
window.location.href = "/sdk.php/Ipa365/paytip/order_id/"+order_id;
}else{
window.location.href=pay_url;
}*/
}
//判断是否是微信浏览器的函数
function isWeiXin(){
//window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息这个属性可以用来判断浏览器类型
var ua = window.navigator.userAgent.toLowerCase();
//通过正则表达式匹配ua中是否含有MicroMessenger字符串
if(ua.match(/MicroMessenger/i) == 'micromessenger'){
return true;
}else{
return false;
}
}
function closeAlert(){
$("#alert_box").hide();
}
function showAlert(){
$("#alert_box").show();
}
</script>
</html>

@ -7,168 +7,313 @@ use Mobile\Controller\SsgController;
// a8eeac3335cef5ee117d357738598f691932513b
class Ipa365Controller extends BaseController{
const signprice = 10; // 超级签价格
public $userinfo;
public function __construct() {
$this->userinfo = $_SESSION['onethink_home']['user_auth'];
parent::__construct();
}
const signprice = 0.01; // 超级签价格
public $userinfo;
public function __construct() {
$this->userinfo = $_SESSION['onethink_home']['user_auth'];
parent::__construct();
}
public function test(){
$user = $this->userinfo;
pp($user);
die();
$ipa365 = new Ipa365Controller();
$result = $ipa365->pay_notify(array(
'trade_id' => "2222",
'order_id' => "SS_20190924170241aEYL"
));
pp($result);
die();
$userId = 1;
$gameId = 1;
$param['price'] = 0.01;
$param['spend_ip'] = get_client_ip();
$param['sdk_version'] = '2';
$param['user_id'] = $userId;
$param['game_id'] = $gameId;
$param['order_id'] = $orderId;
$param['apitype'] = "alipay";
$param['config'] = "alipay";
$param['signtype']= "MD5";
$param['server'] = "alipay.wap.create.direct.pay.by.user";
$param['payway'] = 1;
$param['title'] = $price;
$param['body'] = $price;
$param['callback'] = "http://www.baidu.com";
$param['notifyurl'] = "https://api.wmtxkj.com/callback.php/Notify/sq_callback";
$ret = $this->alipay($param);
redirect($ret['url']);
die;
/* $ipa365 = new Ipa365();
$list = $ipa365->ticketList(array(
'token' => 'Ido9idMgbZlJHMQxjSgTHWZMB00PFEus',
'limit' => 1,
));
pp($list['data']['list'][0]); */
// 授予udid下载权限并获取下载地址
$ret = $ipa365->udidRequest(array(
'token' => 'Ido9idMgbZlJHMQxjSgTHWZMB00PFEus',
'udid' => 'a8eeac3335cef5ee117d357738598f691932513b',
));
pp($ret);
$ret = $ipa365->getinfo(array(
'token' => 'Ido9idMgbZlJHMQxjSgTHWZMB00PFEus',
'udid' => 'a8eeac3335cef5ee117d357738598f691932513b',
));
pp($ret);
$user = $this->userinfo;
pp($user);
die();
$ipa365 = new Ipa365Controller();
$result = $ipa365->pay_notify(array(
'trade_id' => "2222",
'order_id' => "SS_20190924170241aEYL"
));
pp($result);
die();
$userId = 1;
$gameId = 1;
$param['price'] = 0.01;
$param['spend_ip'] = get_client_ip();
$param['sdk_version'] = '2';
$param['user_id'] = $userId;
$param['game_id'] = $gameId;
$param['order_id'] = $orderId;
$param['apitype'] = "alipay";
$param['config'] = "alipay";
$param['signtype']= "MD5";
$param['server'] = "alipay.wap.create.direct.pay.by.user";
$param['payway'] = 1;
$param['title'] = $price;
$param['body'] = $price;
$param['callback'] = "http://www.baidu.com";
$param['notifyurl'] = "https://api.wmtxkj.com/callback.php/Notify/sq_callback";
$ret = $this->alipay($param);
redirect($ret['url']);
die;
/* $ipa365 = new Ipa365();
$list = $ipa365->ticketList(array(
'token' => 'Ido9idMgbZlJHMQxjSgTHWZMB00PFEus',
'limit' => 1,
));
pp($list['data']['list'][0]); */
// 授予udid下载权限并获取下载地址
$ret = $ipa365->udidRequest(array(
'token' => 'Ido9idMgbZlJHMQxjSgTHWZMB00PFEus',
'udid' => 'a8eeac3335cef5ee117d357738598f691932513b',
));
pp($ret);
$ret = $ipa365->getinfo(array(
'token' => 'Ido9idMgbZlJHMQxjSgTHWZMB00PFEus',
'udid' => 'a8eeac3335cef5ee117d357738598f691932513b',
));
pp($ret);
}
public function pay_notify_test() {
die();
$this->pay_notify(array(
'order_id' => 'SS_20190924102317T2jO',
'game_id' => 1,
));
die();
$this->pay_notify(array(
'order_id' => 'SS_20190924102317T2jO',
'game_id' => 1,
));
}
/**
* 订单检查
*/
public function pay_order_check() {
$orderId = I('order_id');
$order = M('game_supersign', 'tab_')->where(array(
'order_id' => $orderId
))->find();
if (!$order) {
echo "订单不存在!";
}
if ($order['pay_status'] == 1) {
redirect(U("Ipa365/install_show", [
'game_id' => $order['game_id'],
'order_id' => $order['order_id']
]));
}
echo "订单正在处理中.请稍后再试!";
exit();
$orderId = I('order_id');
$order = M('game_supersign', 'tab_')->where(array(
'order_id' => $orderId
))->find();
if (!$order) {
echo "订单不存在!";
}
if ($order['pay_status'] == 1) {
redirect(U("Ipa365/install_show", [
'game_id' => $order['game_id'],
'order_id' => $order['order_id']
]));
}
echo "订单正在处理中.请稍后再试!";
exit();
}
/**
*支付中心
*/
public function pay(){
$userId = $this->userinfo['user_id'];
$gameId = I("game_id", 0);
//$price = self::signprice;
if (!$userId ) {
redirect("/mobile.php/ssg/login");
// $this->error("请登入", "/mobile.php/ssg/login");
}
$gameInfo = M('game', 'tab_')->field('game_name,supersign_token')->where(array(
'id' => $gameId,
))->find();
$payLog = M('game_supersign', 'tab_')->where(array(
'user_id' => $userId,
'game_id' => $gameId
))->find();
if($payLog && $payLog['pay_status']==1){
$this->assign("error","亲~您已购买过了~<br/>请到【订单查询】查看订单信息哟~");
$this->display('blank');
}else{
if (!$gameInfo['supersign_token']) {
//$this->error("超级签token未填写");
$this->assign("error","超级签token未配置~");
$this->display('blank');
exit();
}
$this->assign("price", self::signprice);
//$this->assign("order_id", $orderId);
$this->assign("game_id",$gameId);
$this->assign("game_name",$gameInfo['game_name']);
$this->display('pay');
}
}
/*
* 发起支付
*/
public function dopay() {
$userId = $this->userinfo['user_id'];
if (!$userId ) {
redirect("/mobile.php/ssg/login");
}
$gameId = I("game_id", 0);
$paytype = I("pay_type", 'ali');
$price = self::signprice;
if (!$userId || !$gameId) {
//$this->error("参数有误!");
$this->assign("error","参数有误~");
$this->display('blank');
exit();
}
$payLog = M('game_supersign', 'tab_')->where(array(
'user_id' => $userId,
'game_id' => $gameId
))->find();
$gameInfo = M('game', 'tab_')->field('game_name,supersign_token')->where(array(
'id' => $gameId,
))->find();
if ($payLog && $payLog['pay_status']==0) {
$orderId = $payLog['order_id'];
}elseif ($payLog && $payLog['pay_status']==1){
/*$orderId = $payLog['order_id'];
if(stripos($_SERVER['HTTP_HOST'], '.wmtxkj.cn') || $_SERVER['HTTP_HOST']=='127.0.0.1' || stripos($_SERVER['HTTP_HOST'], '.free.idcfengye.com')){
redirect("http://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/$userId/game_id/$gameId/order_id/$orderId");
}else{
redirect("https://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/$userId/game_id/$gameId/order_id/$orderId");
}*/
$this->assign("error","亲~您已购买过了~<br/>请到【订单查询】查看订单信息哟~");
$this->display('blank');
//$this->error("亲~您已购买过了~请到【订单查询】查看订单信息哟~");
exit();
} else {
$orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签
if (!$gameInfo['supersign_token']) {
//$this->error("超级签token未填写");
$this->assign("error","超级签token未配置~");
$this->display('blank');
exit();
}
$r = M('game_supersign', 'tab_')->add(array(
'udid' => '',
'user_id' => $userId,
'game_id' => $gameId,
'order_id' => $orderId,
'pay_price' => $price,
'pay_status' => 0,
'ticket' => '', // 调用安装的时候分配
'token' => $gameInfo['supersign_token'],
'create_time' => time()
));
if (!$r) return -1;
}
if($paytype=='ali'){
$param['price'] = $price;
$param['sdk_version'] = '2';
$param['user_id'] = $userId;
$param['game_id'] = $gameId;
$param['order_id'] = $orderId;
$param['apitype'] = "alipay";
$param['config'] = "alipay";
$param['signtype']= "MD5";
$param['server'] = "alipay.wap.create.direct.pay.by.user";
$param['payway'] = 1;
$param['title'] = $price;
$param['body'] = $price;
//$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";
if(stripos($_SERVER['HTTP_HOST'], '.wmtxkj.cn') || $_SERVER['HTTP_HOST']=='127.0.0.1' || stripos($_SERVER['HTTP_HOST'], '.free.idcfengye.com')){
$param['callback'] = "http://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "http://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
}else{
$param['callback'] = "https://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
}
$ali_pay = $this->alipay($param);
redirect($ali_pay['url']);
}else{
$weixn = new Weixin();
$wx_pay = json_decode($weixn->weixin_pay('超级签消费', $orderId, $price, 'MWEB', 4), true);
if($wx_pay['status']==1){
redirect($wx_pay['mweb_url']);
}else{
$this->assign("error",$wx_pay['return_msg']);
$this->display('blank');
}
}
}
/*
* 发起支付
*/
public function pay() {
$userId = $this->userinfo['user_id'];
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
$gameId = I("game_id", 0);
$price = self::signprice;
if (!$userId || !$gameId) {
$this->error("参数有误!");
}
$payLog = M('game_supersign', 'tab_')->where(array(
'user_id' => $userId,
'game_id' => $gameId
))->find();
public function pay1() {
$userId = $this->userinfo['user_id'];
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
$gameId = I("game_id", 0);
$price = self::signprice;
if (!$userId || !$gameId) {
$this->error("参数有误!");
}
$payLog = M('game_supersign', 'tab_')->where(array(
'user_id' => $userId,
'game_id' => $gameId
))->find();
$gameInfo = M('game', 'tab_')->field('game_name,supersign_token')->where(array(
'id' => $gameId,
))->find();
if ($payLog && $payLog['pay_status']==0) {
$orderId = $payLog['order_id'];
}elseif ($payLog && $payLog['pay_status']==1){
if ($payLog && $payLog['pay_status']==0) {
$orderId = $payLog['order_id'];
}elseif ($payLog && $payLog['pay_status']==1){
$orderId = $payLog['order_id'];
if(stripos($_SERVER['HTTP_HOST'], '.wmtxkj.cn') || $_SERVER['HTTP_HOST']=='127.0.0.1' || stripos($_SERVER['HTTP_HOST'], '.free.idcfengye.com')){
redirect("http://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/$userId/game_id/$gameId/order_id/$orderId");
}else{
redirect("https://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/$userId/game_id/$gameId/order_id/$orderId");
}
$this->error("亲~您已购买过了~请到【订单查询】查看订单信息哟~");
$this->error("亲~您已购买过了~<br/>请到【订单查询】查看订单信息哟~");
} else {
$orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签
if (!$gameInfo['supersign_token']) {
$this->error("超级签token未填写");
}
$r = M('game_supersign', 'tab_')->add(array(
'udid' => '',
'user_id' => $userId,
'game_id' => $gameId,
'order_id' => $orderId,
'pay_price' => $price,
'pay_status' => 0,
'ticket' => '', // 调用安装的时候分配
'token' => $gameInfo['supersign_token'],
'create_time' => time()
));
if (!$r) return -1;
}
$param['price'] = $price;
$param['sdk_version'] = '2';
$param['user_id'] = $userId;
$param['game_id'] = $gameId;
$param['order_id'] = $orderId;
$param['apitype'] = "alipay";
$param['config'] = "alipay";
$param['signtype']= "MD5";
$param['server'] = "alipay.wap.create.direct.pay.by.user";
$param['payway'] = 1;
$param['title'] = $price;
$param['body'] = $price;
//$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";
$orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签
if (!$gameInfo['supersign_token']) {
$this->error("超级签token未填写");
}
$r = M('game_supersign', 'tab_')->add(array(
'udid' => '',
'user_id' => $userId,
'game_id' => $gameId,
'order_id' => $orderId,
'pay_price' => $price,
'pay_status' => 0,
'ticket' => '', // 调用安装的时候分配
'token' => $gameInfo['supersign_token'],
'create_time' => time()
));
if (!$r) return -1;
}
$param['price'] = $price;
$param['sdk_version'] = '2';
$param['user_id'] = $userId;
$param['game_id'] = $gameId;
$param['order_id'] = $orderId;
$param['apitype'] = "alipay";
$param['config'] = "alipay";
$param['signtype']= "MD5";
$param['server'] = "alipay.wap.create.direct.pay.by.user";
$param['payway'] = 1;
$param['title'] = $price;
$param['body'] = $price;
//$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";
if(stripos($_SERVER['HTTP_HOST'], '.wmtxkj.cn') || $_SERVER['HTTP_HOST']=='127.0.0.1' || stripos($_SERVER['HTTP_HOST'], '.free.idcfengye.com')){
$param['callback'] = "http://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "http://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
@ -177,65 +322,65 @@ class Ipa365Controller extends BaseController{
$param['notifyurl'] = "https://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
}
$ret = $this->alipay($param);
$ret = $this->alipay($param);
$this->assign("url", $ret['url']);
$weixn = new Weixin();
$wx_pay = json_decode($weixn->weixin_pay('超级签消费', $orderId, $price, 'MWEB', 4), true);
$this->assign("wxurl", $wx_pay['mweb_url']);
$this->assign("price", self::signprice);
$this->assign("order_id", $orderId);
$this->assign("game_name",$gameInfo['game_name']);
$this->assign("callback",$param['callback']);
$this->assign("price", self::signprice);
//$this->assign("order_id", $orderId);
$this->assign("game_name",$gameInfo['game_name']);
$this->assign("callback",$param['callback']);
$this->display();
$this->display();
}
// 微信分享页面
// 微信分享页面
public function paytip(){
$userId = $this->userinfo['user_id'];
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
$orderId = I('order_id');
$payLog = M('game_supersign', 'tab_')->where(array(
'order_id' => $orderId,
))->find();
$this->assign('url', U('Ipa365/install', array(
'order_id' => $payLog['order_id'],
'user_id' => $payLog['user_id'],
'game_id' => $payLog['game_id'],
)));
$price = $payLog['pay_price'];
$userId = $payLog['user_id'];
$gameId = $payLog['game_id'];
$param['price'] = $price;
$param['sdk_version'] = '2';
$param['user_id'] = $userId;
$param['game_id'] = $gameId;
$param['order_id'] = $orderId;
$param['apitype'] = "alipay";
$param['config'] = "alipay";
$param['signtype']= "MD5";
$param['server'] = "alipay.wap.create.direct.pay.by.user";
$param['payway'] = 1;
$param['title'] = $price;
$param['body'] = $price;
//$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";
$userId = $this->userinfo['user_id'];
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
$orderId = I('order_id');
$payLog = M('game_supersign', 'tab_')->where(array(
'order_id' => $orderId,
))->find();
$this->assign('url', U('Ipa365/install', array(
'order_id' => $payLog['order_id'],
'user_id' => $payLog['user_id'],
'game_id' => $payLog['game_id'],
)));
$price = $payLog['pay_price'];
$userId = $payLog['user_id'];
$gameId = $payLog['game_id'];
$param['price'] = $price;
$param['sdk_version'] = '2';
$param['user_id'] = $userId;
$param['game_id'] = $gameId;
$param['order_id'] = $orderId;
$param['apitype'] = "alipay";
$param['config'] = "alipay";
$param['signtype']= "MD5";
$param['server'] = "alipay.wap.create.direct.pay.by.user";
$param['payway'] = 1;
$param['title'] = $price;
$param['body'] = $price;
//$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";
$param['callback'] = "https://".$_SERVER['HTTP_HOST']."/sdk.php/Ipa365/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
$param['notifyurl'] = "https://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
$ret = $this->alipay($param);
$this->assign("url", $ret['url']);
$ret = $this->alipay($param);
$this->assign("url", $ret['url']);
$weixn = new Weixin();
$wx_pay = json_decode($weixn->weixin_pay('超级签消费', $orderId, $price, 'MWEB', 4), true);
@ -252,200 +397,200 @@ class Ipa365Controller extends BaseController{
* 下载页面 判断订单是否支付成功
*/
public function install_show() {
$orderId = I('order_id', 0);
$gameId = I('game_id', 0);
/* $userId = I('user_id', 0);
$user = M('user', 'tab_')->where(array(
'id' => $userId
))->find(); */
$userId = $this->userinfo['user_id'];
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
$orderId = I('order_id', 0);
$gameId = I('game_id', 0);
/* $userId = I('user_id', 0);
$user = M('user', 'tab_')->where(array(
'id' => $userId
))->find(); */
$userId = $this->userinfo['user_id'];
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
// $userId = $_SESSION['user_id'];
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
if (!$orderId || !$gameId || !$userId) {
$this->error("参数校验失败,请重试");
}
$supersign = M('game_supersign', 'tab_')->where(array('order_id' => $orderId,"game_id"=>$gameId))->find();
if (!$supersign) {
$this->error("订单不存在");
}
if ($supersign['pay_status'] != 1) {
$this->error("订单未支付");
}
$game = M('game', 'tab_')->where(array('id' => $gameId))->find();
$this->assign('game', $game);
$this->assign('url', U('Ipa365/install', array(
'order_id' => $orderId,
'user_id' => $userId,
'game_id' => $gameId
)));
//获取礼包码
$giftbag = M('giftbag', 'tab_')->field("*")->where(array("game_id"=>$gameId,"giftbag_version"=>3))->find();
if(empty($giftbag)){
$giftbag = false;
}else{
$desribe = $giftbag['desribe'];
$mygif = $this->checkAccountGiftExist($userId,$giftbag['id']);
if(!empty($mygif)){
//已经领取
$giftbag =$mygif;
}else{
if($giftbag['novice_num']>0){
//领取
$giftbag = $this->getNovice($userId,$this->userinfo['account'],$giftbag['id']);
}
}
$giftbag['desribe'] = $desribe;
}
//验证是否领取
$this->assign('giftbag', $giftbag);
$this->display();
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
if (!$orderId || !$gameId || !$userId) {
$this->error("参数校验失败,请重试");
}
$supersign = M('game_supersign', 'tab_')->where(array('order_id' => $orderId,"game_id"=>$gameId))->find();
if (!$supersign) {
$this->error("订单不存在");
}
if ($supersign['pay_status'] != 1) {
$this->error("订单未支付");
}
$game = M('game', 'tab_')->where(array('id' => $gameId))->find();
$this->assign('game', $game);
$this->assign('url', U('Ipa365/install', array(
'order_id' => $orderId,
'user_id' => $userId,
'game_id' => $gameId
)));
//获取礼包码
$giftbag = M('giftbag', 'tab_')->field("*")->where(array("game_id"=>$gameId,"giftbag_version"=>3))->find();
if(empty($giftbag)){
$giftbag = false;
}else{
$desribe = $giftbag['desribe'];
$mygif = $this->checkAccountGiftExist($userId,$giftbag['id']);
if(!empty($mygif)){
//已经领取
$giftbag =$mygif;
}else{
if($giftbag['novice_num']>0){
//领取
$giftbag = $this->getNovice($userId,$this->userinfo['account'],$giftbag['id']);
}
}
$giftbag['desribe'] = $desribe;
}
//验证是否领取
$this->assign('giftbag', $giftbag);
$this->display();
}
/**
* 获取用户安装历史url
*/
public function get_install_list() {
/* $gameId = I('game_id', 0);
$where = array(
'pay_status' => 1,
'ticket' => array('neq', '')
);
if ($id) $where['game_id'] = $gameId;
$list = M('game_supersign', 'tab_')->where($where)->select();
/* $gameId = I('game_id', 0);
$where = array(
'pay_status' => 1,
'ticket' => array('neq', '')
);
if ($id) $where['game_id'] = $gameId;
$list = M('game_supersign', 'tab_')->where($where)->select();
// pp($list);
$url = $game['supersign_url']."?code={$code}";
pp($url);
redirect($url); */
$url = $game['supersign_url']."?code={$code}";
pp($url);
redirect($url); */
}
/**
* 用户点击安装
*/
public function install() {
$userId = $this->userinfo['user_id'];
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
$gameId = I('game_id', 0);
$orderId = I('order_id', 0);
if (!$userId || !$gameId || !$orderId) {
$this->error("参数有误!");
}
M()->startTrans();
// 获取支付记录
$gamesign = M('game_supersign', 'tab_')->where(array(
'order_id' => $orderId,
'user_id' => $userId,
'game_id' => $gameId,
'pay_status' => 1,
))->find();
if (!$gamesign) {
// pp(M('game_supersign', 'tab_')->_sql());
$this->error("支付记录不存在");
}
if ($gamesign['url']) {
redirect($gamesign['url']);
}
$token = $gamesign['token'];
$ipa365 = new Ipa365();
$i = 1;
while (1) {
// 获取授权码
$list = $ipa365->ticketList(array(
'token' => $token,
'limit' => $i,
)); // @todo: 并发授权码已分配的情况
$code = $list['data']['list'][$i-1]['code'];
$codeExists = M('game_supersign', 'tab_')->field('id')->where(array(
'ticket' => $code,
))->find();
if (!$codeExists) {
break;
}
$i ++;
}
$game = M('game', 'tab_')->where(array(
'id' => $gameId,
))->find();
$url = $game['supersign_url']."?code={$code}";
$r = M('game_supersign', 'tab_')->where(array(
'user_id' => $userId,
'game_id' => $gameId,
'pay_status' => 1
))->save(array(
'ticket' => $code, // 调用安装的时候分配
'url' => $url,
));
if (!$r) {
pp(M('game_supersign', 'tab_')->_sql());
M()->rollback();
return -1;
}
M()->commit();
// 调用第三方连接
$userId = $this->userinfo['user_id'];
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
$gameId = I('game_id', 0);
$orderId = I('order_id', 0);
if (!$userId || !$gameId || !$orderId) {
$this->error("参数有误!");
}
M()->startTrans();
// 获取支付记录
$gamesign = M('game_supersign', 'tab_')->where(array(
'order_id' => $orderId,
'user_id' => $userId,
'game_id' => $gameId,
'pay_status' => 1,
))->find();
if (!$gamesign) {
// pp(M('game_supersign', 'tab_')->_sql());
$this->error("支付记录不存在");
}
if ($gamesign['url']) {
redirect($gamesign['url']);
}
$token = $gamesign['token'];
$ipa365 = new Ipa365();
$i = 1;
while (1) {
// 获取授权码
$list = $ipa365->ticketList(array(
'token' => $token,
'limit' => $i,
)); // @todo: 并发授权码已分配的情况
$code = $list['data']['list'][$i-1]['code'];
$codeExists = M('game_supersign', 'tab_')->field('id')->where(array(
'ticket' => $code,
))->find();
if (!$codeExists) {
break;
}
$i ++;
}
$game = M('game', 'tab_')->where(array(
'id' => $gameId,
))->find();
$url = $game['supersign_url']."?code={$code}";
$r = M('game_supersign', 'tab_')->where(array(
'user_id' => $userId,
'game_id' => $gameId,
'pay_status' => 1
))->save(array(
'ticket' => $code, // 调用安装的时候分配
'url' => $url,
));
if (!$r) {
pp(M('game_supersign', 'tab_')->_sql());
M()->rollback();
return -1;
}
M()->commit();
// 调用第三方连接
// pp($url);
redirect($url);
redirect($url);
}
/*
* 打包列表
*/
public function pay_list() {
$userId = $this->userinfo['user_id'];
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
$list = M('game_supersion', 'tab_')->where(array(
'user_id' => $userId,
))->select();
$this->assign("list", $list);
$this->display();
}
// alipay
public function alipay($param) {
$pay = new \Think\Pay($param['apitype'],C($param['config']));
$vo = new \Think\Pay\PayVo();
$vo->setBody("超级签消费")
->setFee($param['price'])//支付金额
->setTitle($param['title'])
->setOrderNo($param['order_id'])
->setService($param['server'])
->setSignType($param['signtype'])
->setPayMethod("wap")
->setTable("supersign")
->setPayWay($param['payway'])
->setCallback($param['callback'])
->setNotifyUrl($param['notifyurl'])
->setGameName(get_game_name($param['game_id']))
->setServerId(0)
->setUserId($param['user_id'])
->setSdkVersion($param['sdk_version']);
$pay_['url']= $pay->buildRequestForm($vo);
//$pay_['out_trade_no']= $out_trade_no;
return $pay_;
}
//领取礼包码
public function getNovice($user_id,$account,$gift_id){
public function pay_list() {
$userId = $this->userinfo['user_id'];
if (!$userId ) {
$this->error("请登入", "/mobile.php/ssg/login");
}
$list = M('game_supersion', 'tab_')->where(array(
'user_id' => $userId,
))->select();
$this->assign("list", $list);
$this->display();
}
// alipay
public function alipay($param) {
$pay = new \Think\Pay($param['apitype'],C($param['config']));
$vo = new \Think\Pay\PayVo();
$vo->setBody("超级签消费")
->setFee($param['price'])//支付金额
->setTitle($param['title'])
->setOrderNo($param['order_id'])
->setService($param['server'])
->setSignType($param['signtype'])
->setPayMethod("wap")
->setTable("supersign")
->setPayWay($param['payway'])
->setCallback($param['callback'])
->setNotifyUrl($param['notifyurl'])
->setGameName(get_game_name($param['game_id']))
->setServerId(0)
->setUserId($param['user_id'])
->setSdkVersion($param['sdk_version']);
$pay_['url']= $pay->buildRequestForm($vo);
//$pay_['out_trade_no']= $out_trade_no;
return $pay_;
}
//领取礼包码
public function getNovice($user_id,$account,$gift_id){
$data =M("giftbag",'tab_')->find($gift_id);
$novice_str = $data['novice'];
$novice_arr = str2arr($novice_str,",");
@ -483,8 +628,8 @@ class Ipa365Controller extends BaseController{
M("giftbag",'tab_')->commit();
return $record;
}
}
public function checkAccountGiftExist($user_id,$gift_id){
}
public function checkAccountGiftExist($user_id,$gift_id){
$map['user_id'] = $user_id;
$map['gift_id'] = $gift_id;
return M("gift_record",'tab_')->field('*')->where($map)->find();

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1, maximum-scale=1, user-scalable=no">
<title>错误信息</title>
<link href="__CSS__/ssg/common.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="blank-box">
<div class="title">
<img class="gologin" src="__IMG__/ssg/alipay/back.png" onclick="javascript:history.go(-1)">
<div class="content">错误信息</div>
<div class="titleright"></div>
</div>
<div class="cell-box">
<img src="__IMG__/ssg/error.png">
</div>
<p>{$error}</p>
<!--<div class="resbtn">
<a href="#">
刷新页面
</a>
</div>-->
</div>
</body>
<script src="__JS__/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="__JS__/ssg/common.js" type="text/javascript"></script>
<script>
</script>
</html>

@ -64,7 +64,7 @@ body{
<div class="order-checkbank-tit">请选择付款方式:</div>
<ul class="order-checkbank-list">
<li>
<a href="{$url}"
<a href="/sdk.php/Ipa365/dopay/game_id/{$game_id}/pay_type/ali"
title="支付宝">
<img src="__IMG__/ssg/alipay/zfb-icon.png" alt="支付宝">
</a>
@ -115,7 +115,7 @@ body{
<span>{$price}</span>
</div>
<a class="order-payinfo-item"
href="#;" onclick="jump('{$url}', '{$order_id}','alipay')"
href="#;" onclick="jump('/sdk.php/Ipa365/dopay/game_id/{$game_id}/pay_type/ali')"
title="支付宝" style="padding: .3rem 0;width: 6.3rem;margin-left: .3rem;">
<div class="order-payinfo-icon" style="width: .7rem;height: .7rem;">
<img src="__IMG__/ssg/alipay/zfb-pic.jpg" style="width: 100%;height: 100%;border: 0px;" alt="支付宝">
@ -125,9 +125,8 @@ body{
<div class="pay-meta">推荐支付宝用户使用</div>
</div>
</a>
<if condition="$wxurl neq ''">
<a class="order-payinfo-item"
href="#;" onclick="jump('{$wxurl}', '{$order_id}','wxpay')"
href="#;" onclick="jump('/sdk.php/Ipa365/dopay/game_id/{$game_id}/pay_type/wx')"
title="微信支付" style="padding: .3rem 0;width: 6.3rem;margin-left: .3rem;">
<div class="order-payinfo-icon" style="width: .7rem;height: .7rem;">
<img src="__IMG__/ssg/alipay/wxpay.png" style="width: 100%;height: 100%;border: 0px;" alt="微信支付">
@ -137,7 +136,6 @@ body{
<div class="pay-meta">推荐微信用户使用</div>
</div>
</a>
</if>
</div>
</div>
<!--<div class="footer-pay">
@ -145,14 +143,15 @@ body{
</div>-->
</body>
<script>
function jump(pay_url, order_id,paytype='alipay') {
if(paytype=='alipay'){
function jump(pay_url) {
window.location.href = pay_url;
/*if(paytype=='alipay'){
window.location.href = pay_url;
}else{
showAlert();
window.location.href = pay_url;
//window.open(pay_url,"_blank");
}
}*/
/*if(isWeiXin()){
window.location.href = "/sdk.php/Ipa365/paytip/order_id/"+order_id;
}else{

@ -158,6 +158,7 @@ CREATE TABLE `tab_protect_log_read` (
`create_time` int(11) DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
-- 增加用户Token 验证用户
ALTER TABLE `tab_user`
ADD COLUMN `user_token` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户token 登入时下发' AFTER `token`;
@ -165,4 +166,17 @@ ADD COLUMN `user_token` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT
-- ----------------------------
-- 2019-10-17 zyx
-- ----------------------------
alter table `tab_giftbag` modify COLUMN `giftbag_version` tinyint(2) COMMENT '运营平台 0双平台 1and 2ios 3超级签'
alter table `tab_giftbag` modify COLUMN `giftbag_version` tinyint(2) COMMENT '运营平台 0双平台 1and 2ios 3超级签'
-- ----------------------------
-- 2019-10-17 zyx
-- ----------------------------
ALTER TABLE `tab_test_resource`
MODIFY COLUMN `user_account` varchar(50) BINARY CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户帐号' AFTER `user_id`;
ALTER TABLE `tab_test_resource`
MODIFY COLUMN `role_name` varchar(50) BINARY CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '角色名' AFTER `phone`,
MODIFY COLUMN `promote_account` varchar(30) BINARY CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '所属推广员账号' AFTER `promote_id`;
-- 2019-10-22 cxj
UPDATE `sys_model` SET list_grid = "id:编号\r\nsort:排序\r\ngame_name:游戏名称\r\ngame_type_name:游戏类型\r\ngame_type_id:游戏类型\r\ngame_appid:游戏appid\r\ngame_status|get_info_status:显示状态\r\npay_status|get_info_status:支付状态\r\nicon:图片id\r\napply_status:审核状态\r\ncategory:开放类型\r\nrecommend_status|get_info_status*1:推荐状态\r\nrelation_game_id:关联游戏id\r\nrelation_game_name:关联游戏名称\r\nsdk_version:运营平台\r\ndevelopers:开发商\r\ndow_num:下载\r\nonline_status:上线状态\r\ncreate_time:创建时间\r\nserver_type:混服管理\r\nid:操作:[EDIT]&id=[id]|编辑,Game/del?ids=[id]|删除" where id = 15;

@ -447,6 +447,7 @@ function showBtn() {
//导航高亮
function highlight_subnav(url){
console.log(url)
$('.side-sub-menu').find('a[href="'+url+'"]').closest('li').addClass('current');
/*显示选中的菜单*/
$('.side-sub-menu').find("a[href='" + url + "']").parent().parent().prev("h3").removeClass('no').find("i").removeClass("icon-fold");

@ -480,7 +480,7 @@ font-size: .16rem;
.login-page .loginbox .login-footer img{
width: .3rem;height: .3rem;
}
.login-page .loginbox .login-footer .chatqq{
.login-page .loginbox .login-footer .content{
font-size: .24rem;color:#21B1EB;margin-left: .1rem;
}
.login-page .loginbox .login-btn-group .login-btn-big{
@ -788,4 +788,149 @@ font-size: .16rem;color: #fff;
flex-grow: 1;
font-size: .28rem;
color: #292929;
}
}
/*# sourceMappingURL=common.css.map */
/* install-box */
.install-box .title{
display: flex;
height: .9rem;
width: 100%;
justify-content: space-between;
align-items: center;
background-color: #21B1EB;
}
.install-box .title img,
.install-box .titleright {
width: .3rem;
height: .3rem;
}
.install-box .vip-download .game-info .game-icon img{
width: 1.1rem;
height: 1.1rem;
}
.install-box .vip-download .game-info .game-title{
top: 1.8rem;
}
.install-box .vip-download .game-info .game-rule{
top: 2.24rem;
}
.install-box .vip-download .game-info .download-button{
bottom:.5rem
}
.install-box .vip-download .game-info .download-button a{
margin: 0 auto;
display: block;
width: 2.4rem;
height: 0.6rem;
text-align: center;
line-height: 0.6rem;
background-color: #f7ca02;
border-radius: 0.3rem;
font-size: 0.28rem;
}
.install-box .shaddowbox {
background-color: #fff;
border-radius: .16rem;
box-shadow: 0px 0px 6px 0px rgba(89, 40, 8, 0.15);
}
.install-box .vip-download .game-gift{
padding: 0 .3rem;
}
.install-box .title-3{
height: 0.89rem;
line-height: 0.89rem;
border-bottom-color: #f0f0f0;
border-bottom-width: 1px;
border-bottom-style: solid;
}
.install-box .title-3 h2{
font-size: .28rem;
}
.install-box .vip-download .game-gift .gift-list li{
padding-bottom: 0.3rem;
}
.install-box .vip-download .game-gift .gift-list li .gift-title{
height: .84rem;
line-height:.84rem;
text-align: left;
}
.install-box .vip-download .game-gift .gift-list li .gift-title h2{
padding-left: 0.36rem;
background-size: 0.25rem 0.25rem;
font-size: 0.28rem;
}
.install-box p,input{
font-size: .24rem;
}
.install-box .vip-download .game-gift .gift-list li .gift-code{
margin: 0.16rem 0.1rem 0;
padding-left: 1.3rem;
padding-right: 1rem;
height: 0.6rem;
line-height: 0.6rem;
background-color: #f5f5f5;
border-radius: 0.30rem;
}
.install-box .vip-download .game-gift .gift-list li .gift-code a{
width: 1.78rem;
height: 0.6rem;
line-height: 0.6rem;
text-align: center;
background-color: #21B1EB;
border-radius: 0.3rem;
color: #fff;
}
.install-box .gift-info{
font-size: .20rem;
}
.install-box .vip-download .game-gift .gift-list li .gift-code label{
left: .28rem;
}
/* blank-page */
.blank-box{
font-size: .16rem;
color: #292929;
background-color: #fff;
min-height: 100vh;
}
.blank-box .title {
display: flex;
height: .45rem;
width: 100%;
justify-content: space-between;
align-items: center;
background-color: #21B1EB;
}
.blank-box .title img,
.blank-box .titleright {
width: .15rem;
height: .15rem;
}
.blank-box .title img{
margin-left:.12rem;
}
.blank-box .titleright {
margin-right:.12rem;
}
.blank-box .title .content{
font-size: .16rem;color: #fff;
}
.blank-box .cell-box{
width: 100%;padding:.9rem 0 0;display: flex;justify-content: center
}
.blank-box .cell-box img{
width: 2rem;height: 1.2rem;
}
.blank-box p{
width: 100%;font-size: .16rem;text-align: center;line-height: 1.5;margin-top: .3rem;
}
.blank-box .resbtn{
width: 100%;padding:.35rem 0 0;display: flex;justify-content: center;
}
.blank-box .resbtn a{
width: 1.1rem;height: .35rem;border-radius: 35px;text-align: center;color: #fff;background-color:#21B1EB;line-height: .35rem;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 963 KiB

After

Width:  |  Height:  |  Size: 956 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 654 KiB

After

Width:  |  Height:  |  Size: 649 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 KiB

After

Width:  |  Height:  |  Size: 735 KiB

@ -0,0 +1,122 @@
/*!
* jquery.base64.js 0.1 - https://github.com/yckart/jquery.base64.js
* Makes Base64 en & -decoding simpler as it is.
*
* Based upon: https://gist.github.com/Yaffle/1284012
*
* Copyright (c) 2012 Yannick Albert (http://yckart.com)
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
* 2013/02/10
**/
;(function($) {
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
a256 = '',
r64 = [256],
r256 = [256],
i = 0;
var UTF8 = {
/**
* Encode multi-byte Unicode string into utf-8 multiple single-byte characters
* (BMP / basic multilingual plane only)
*
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars
*
* @param {String} strUni Unicode string to be encoded as UTF-8
* @returns {String} encoded string
*/
encode: function(strUni) {
// use regular expressions & String.replace callback function for better efficiency
// than procedural approaches
var strUtf = strUni.replace(/[\u0080-\u07ff]/g, // U+0080 - U+07FF => 2 bytes 110yyyyy, 10zzzzzz
function(c) {
var cc = c.charCodeAt(0);
return String.fromCharCode(0xc0 | cc >> 6, 0x80 | cc & 0x3f);
})
.replace(/[\u0800-\uffff]/g, // U+0800 - U+FFFF => 3 bytes 1110xxxx, 10yyyyyy, 10zzzzzz
function(c) {
var cc = c.charCodeAt(0);
return String.fromCharCode(0xe0 | cc >> 12, 0x80 | cc >> 6 & 0x3F, 0x80 | cc & 0x3f);
});
return strUtf;
},
/**
* Decode utf-8 encoded string back into multi-byte Unicode characters
*
* @param {String} strUtf UTF-8 string to be decoded back to Unicode
* @returns {String} decoded string
*/
decode: function(strUtf) {
// note: decode 3-byte chars first as decoded 2-byte strings could appear to be 3-byte char!
var strUni = strUtf.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g, // 3-byte chars
function(c) { // (note parentheses for precence)
var cc = ((c.charCodeAt(0) & 0x0f) << 12) | ((c.charCodeAt(1) & 0x3f) << 6) | (c.charCodeAt(2) & 0x3f);
return String.fromCharCode(cc);
})
.replace(/[\u00c0-\u00df][\u0080-\u00bf]/g, // 2-byte chars
function(c) { // (note parentheses for precence)
var cc = (c.charCodeAt(0) & 0x1f) << 6 | c.charCodeAt(1) & 0x3f;
return String.fromCharCode(cc);
});
return strUni;
}
};
while(i < 256) {
var c = String.fromCharCode(i);
a256 += c;
r256[i] = i;
r64[i] = b64.indexOf(c);
++i;
}
function code(s, discard, alpha, beta, w1, w2) {
s = String(s);
var buffer = 0,
i = 0,
length = s.length,
result = '',
bitsInBuffer = 0;
while(i < length) {
var c = s.charCodeAt(i);
c = c < 256 ? alpha[c] : -1;
buffer = (buffer << w1) + c;
bitsInBuffer += w1;
while(bitsInBuffer >= w2) {
bitsInBuffer -= w2;
var tmp = buffer >> bitsInBuffer;
result += beta.charAt(tmp);
buffer ^= tmp << bitsInBuffer;
}
++i;
}
if(!discard && bitsInBuffer > 0) result += beta.charAt(buffer << (w2 - bitsInBuffer));
return result;
}
var Plugin = $.base64 = function(dir, input, encode) {
return input ? Plugin[dir](input, encode) : dir ? null : this;
};
Plugin.btoa = Plugin.encode = function(plain, utf8encode) {
plain = Plugin.raw === false || Plugin.utf8encode || utf8encode ? UTF8.encode(plain) : plain;
plain = code(plain, false, r256, b64, 8, 6);
return plain + '===='.slice((plain.length % 4) || 4);
};
Plugin.atob = Plugin.decode = function(coded, utf8decode) {
coded = String(coded).split('=');
var i = coded.length;
do {--i;
coded[i] = code(coded[i], true, r64, a256, 6, 8);
} while (i > 0);
coded = coded.join('');
return Plugin.raw === false || Plugin.utf8decode || utf8decode ? UTF8.decode(coded) : coded;
};
}(jQuery));

@ -0,0 +1 @@
!function(){var e="object"==typeof exports&&null!==exports&&"number"!=typeof exports.nodeType?exports:"undefined"!=typeof self?self:$.global,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function f(e){this.message=e}(f.prototype=new Error).name="InvalidCharacterError",e.btoa||(e.btoa=function(e){for(var t,r,o=String(e),n=0,a=c,i="";o.charAt(0|n)||(a="=",n%1);i+=a.charAt(63&t>>8-n%1*8)){if(255<(r=o.charCodeAt(n+=.75)))throw new f("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");t=t<<8|r}return i}),e.atob||(e.atob=function(e){var t=String(e).replace(/[=]+$/,"");if(t.length%4==1)throw new f("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,o,n=0,a=0,i="";o=t.charAt(a++);~o&&(r=n%4?64*r+o:o,n++%4)?i+=String.fromCharCode(255&r>>(-2*n&6)):0)o=c.indexOf(o);return i})}();

@ -316,4 +316,51 @@ input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: #
}
.install-box .vip-download .game-gift .gift-list li .gift-code label{
left: .28rem;
}
}
/* blank-page */
.blank-box{
font-size: .16rem;
color: #292929;
background-color: #fff;
min-height: 100vh;
}
.blank-box .title {
display: flex;
height: .45rem;
width: 100%;
justify-content: space-between;
align-items: center;
background-color: #21B1EB;
}
.blank-box .title img,
.blank-box .titleright {
width: .15rem;
height: .15rem;
}
.blank-box .title img{
margin-left:.12rem;
}
.blank-box .titleright {
margin-right:.12rem;
}
.blank-box .title .content{
font-size: .16rem;color: #fff;
}
.blank-box .cell-box{
width: 100%;padding:.9rem 0 0;display: flex;justify-content: center
}
.blank-box .cell-box img{
width: 2rem;height: 1.2rem;
}
.blank-box p{
width: 100%;font-size: .16rem;text-align: center;line-height: 1.5;margin-top: .3rem;
}
.blank-box .resbtn{
width: 100%;padding:.35rem 0 0;display: flex;justify-content: center;
}
.blank-box .resbtn a{
width: 1.1rem;height: .35rem;border-radius: 35px;text-align: center;color: #fff;background-color:#21B1EB;line-height: .35rem;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Loading…
Cancel
Save