From 6ed821429f81a598f8c2063362bfe8417952a043 Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Thu, 17 Oct 2019 09:44:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mobile/Controller/SsgController.class.php | 44 +++- Application/Mobile/View/Ssg/index.html | 219 ++++++++++++++---- Public/Mobile/js/ssg/juicer.min.js | 1 + 3 files changed, 209 insertions(+), 55 deletions(-) create mode 100644 Public/Mobile/js/ssg/juicer.min.js diff --git a/Application/Mobile/Controller/SsgController.class.php b/Application/Mobile/Controller/SsgController.class.php index 748706bb3..93e4a4ebf 100644 --- a/Application/Mobile/Controller/SsgController.class.php +++ b/Application/Mobile/Controller/SsgController.class.php @@ -224,10 +224,10 @@ class SsgController extends BaseController { //首页 public function index(){ $user = session("user_auth"); - // if (!$user) { - // redirect(U("ssg/login")); - // //$this->error("请登入", U('ssg/login')); - // } + if (!$user) { + redirect(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,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(); @@ -243,6 +243,42 @@ class SsgController extends BaseController { $this->assign("data_list",$game_list); $this->display(); } + public function getGamaList() + { + + $user = session("user_auth"); + $game_name = I("game_name", false); + $type = I("type",false); + $map = []; + if($game_name){ + $map["game_name"] = array("like","%{$game_name}%"); + } + $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++) { + $game_list[$i]["game_icon"] = get_cover($game_list[$i]["icon"], 'path'); + } + $res = array("list"=>$game_list); + if($type == 1){ + $map['user_id']= $user['user_id']; + $map['pay_status'] = 1; + $userpay = M("game_supersign","tab_")->field("game_id")->where($map)->select(); + if(empty($userpay)){ + $userpay = []; + }else{ + $tmparr = []; + for ($i=0; $i < count($userpay); $i++) { + # code... + $tmparr[] = $userpay[$i]["game_id"]; + } + $userpay = $tmparr; + } + $res["pay_game_id"] = $userpay; + } + $this->ajaxReturn($res,'JSON'); + # code... + } public function order(){ //.echo md5(sha1('123456') . 'UmtW6-Z(S^8xvwDn;B:J{X7FG9z2+Np.|C#~QRY"');exit(); diff --git a/Application/Mobile/View/Ssg/index.html b/Application/Mobile/View/Ssg/index.html index 495176905..57babcca4 100644 --- a/Application/Mobile/View/Ssg/index.html +++ b/Application/Mobile/View/Ssg/index.html @@ -9,6 +9,7 @@