Merge branch 'dev' of 47.111.118.107:/srv/git/platform into dev

master
ELF 5 years ago
commit 6d9db68cd2

@ -20,10 +20,10 @@ class SsgController extends BaseController {
public function login(){
$user = session("user_auth");
if ($user) {
redirect(U("ssg/index"));
}
$user = session("user_auth");
if ($user) {
redirect(U("ssg/index"));
}
$this->display();
}
@ -87,32 +87,42 @@ class SsgController extends BaseController {
//首页
public function index(){
$user = session("user_auth");
if (!$user) {
$user = session("user_auth");
if (!$user) {
redirect(U("ssg/login"));
//$this->error("请登入", U('ssg/login'));
}
//$this->error("请登入", U('ssg/login'));
}
$map['a.user_id']= $user['user_id'];
$map['a.sdk_version'] = 2;
$game_list = M("user_play a","tab_")->field("b.*,b.id as game_id")->join("tab_game b on a.game_id=b.id")->where($map)->select();
$game_list = M("user_play a","tab_")->field("b.*,b.id as game_id,od.pay_status")->join("inner join tab_game b on a.game_id=b.id left join tab_game_supersign od on od.user_id=a.user_id and od.game_id=b.id and od.pay_status=1")->where($map)->select();
$this->assign("data_list",$game_list);
$this->display();
}
public function order(){
//.echo md5(sha1('123456') . 'UmtW6-Z(S^8xvwDn;B:J{X7FG9z2+Np.|C#~QRY"');exit();
$user = session("user_auth");
if (!$user) {
//.echo md5(sha1('123456') . 'UmtW6-Z(S^8xvwDn;B:J{X7FG9z2+Np.|C#~QRY"');exit();
$user = session("user_auth");
if (!$user) {
redirect(U("ssg/login"));
//$this->error("请登入", U('ssg/login'));
}
//$this->error("请登入", U('ssg/login'));
}
$order_list = M("game_supersign a","tab_")->field("a.order_id, b.game_name, b.icon, b.id as game_id, a.pay_status, a.user_id")->join("left join tab_game b on a.game_id=b.id")->where(array(
'a.user_id' => $user['user_id'],
$order_list = M("game_supersign a","tab_")->field("a.order_id, b.game_name, b.icon, b.id as game_id, a.pay_status, a.user_id, a.create_time")->join("left join tab_game b on a.game_id=b.id")->where(array(
'a.user_id' => $user['user_id'],
))->order("a.id")->select();
// pp($order_list);
foreach ($order_list as $key => $value){
$deff = $this->timediffs(time(),$value['create_time']);
//计算分钟数
if(($deff['day']+ $deff['hour'])>=1 || $deff['min']>30){
$order_list[$key]['invalid']=1;
}else{
$order_list[$key]['invalid']=0;
}
}
$this->assign("data_list", $order_list);
$this->assign("nowtime", time());
$this->display();
}
@ -138,9 +148,33 @@ class SsgController extends BaseController {
// 支付页面
public function alipay($data) {
$this->assign("url", $data['url']);
$this->assign("price", $data['price']);
$this->assign("url", $data['url']);
$this->assign("price", $data['price']);
$this->display();
}
public function timediffs($begin_time, $end_time) {
if ($begin_time < $end_time) {
$starttime = $begin_time;
$endtime = $end_time;
} else {
$starttime = $end_time;
$endtime = $begin_time;
}
$this->display();
//计算天数
$timediff = $endtime - $starttime;
$days = intval($timediff / 86400);
//计算小时数
$remain = $timediff % 86400;
$hours = intval($remain / 3600);
//计算分钟数
$remain = $remain % 3600;
$mins = intval($remain / 60);
//计算秒数
$secs = $remain % 60;
$res = array("day" => $days, "hour" => $hours, "min" => $mins, "sec" => $secs);
return $res;
}
}

@ -29,6 +29,12 @@
background-repeat: no-repeat;
background-size: 100%;
}
.protect-box .inner{
background-image: url(__IMG__/ssg/box-bg.png);
}
.install-box .inner{
background-image: url(__IMG__/ssg/box-bg2.png);
}
</style>
</head>

@ -11,7 +11,7 @@
<body>
<div class="page-container ">
<div class="top">
<a href="{:U('order')}" class="link">订单查询</a>
<a href="javascript:history.go(-1);"></a><a href="{:U('order')}" class="link">订单查询</a>
</div>
<style>
.interval {
@ -43,7 +43,7 @@
<div class="product-list">
<ul>
<volist name="data_list" id="data">
<li onclick="handleGameID('{$data.game_id}','{$data.game_name}')">
<li onclick="handleGameID('{$data.game_id}','{$data.game_name}','{$data.pay_status}')">
<dl>
<dt><img src="{$data['icon']|get_cover='path'}"></dt>
<dd class="product-title">{$data.game_name}-超级签&nbsp;<i></i></dd>
@ -57,6 +57,7 @@
</ul>
<input type="hidden" id="hdGameID" value="{$data_list[0]['game_id']}">
<input type="hidden" id="orderStatus" value="{$data_list[0]['pay_status']}">
<script>
</script>
@ -86,16 +87,21 @@
//联系客服
window.location.href = decodeURIComponent("https://www.sobot.com/chat/h5/index.html?sysNum=823d139047674564bfc040e60c4a1a18&color=fa8932&customerFields={'customField8':'" + userID + "'}");
}*/
function handleGameID(gameID, gameName) {
function handleGameID(gameID, gameName,orderStatus) {
var hdGameID = $("#hdGameID").val();
$("#hdGameID").val(hdGameID == gameID ? 0 : gameID);
$("#orderStatus").val(orderStatus);
$("#txtgamename").text(gameName + "-超级签");
}
function handlePay() {
var hdGameID = $("#hdGameID").val();
var orderStatus = $("#orderStatus").val();
if (!hdGameID || hdGameID == 0) {
alert("请选择游戏");
} else {
} else if(orderStatus==1){
alert("亲~您已购买过了~请到【订单查询】查看订单信息哟~");
}else {
location.href = "/sdk.php/Ipa365/pay/game_id/"+hdGameID;
}
}

@ -33,9 +33,12 @@
<dd class="order-title">{$data['game_name']}</dd>
<if condition="$data['pay_status'] eq '1'">
<dd class="order-status"></dd>
</if>
<if condition="$data['pay_status'] eq '0'">
<a href="/sdk.php/Ipa365/pay/game_id/{$data['game_id']}"><dd class="order-pay">立即支付</dd></a>
<else />
<if condition="$data['pay_status'] eq '0' and $data['invalid'] eq 0">
<a href="/sdk.php/Ipa365/pay/game_id/{$data['game_id']}"><dd class="order-pay">立即支付</dd></a>
<else />
<dd class="order-pay" style="color:gray">已失效</dd>
</if>
</if>
<!--
<dd class="order-pay" style="color:gray">已失效</dd>
@ -45,7 +48,9 @@
</volist>
</ul>
<else />
<div class="no-order"></div>
<div class="no-order">
您还没有订单哟~快去下单吧~
</div>
</if>
</div>
<script>

Loading…
Cancel
Save