diff --git a/Application/Sdk/Controller/GameGiftPageController.class.php b/Application/Sdk/Controller/GameGiftPageController.class.php index 3c86d288..759357d0 100644 --- a/Application/Sdk/Controller/GameGiftPageController.class.php +++ b/Application/Sdk/Controller/GameGiftPageController.class.php @@ -4,9 +4,12 @@ use Think\Controller; use Common\Api\GaemApi; class GameGiftPageController extends BaseController{ - public function gift_list($game_id = 0){ + public function gift_list(){ $request = json_decode(base64_decode(file_get_contents("php://input")),true); + if (I("debug") == 1) { + $data['user_token'] = 'b9c9739f7e3dc0b338dc3f4a4f02cb29'; + } $gift = M("Giftbag","tab_"); $map['game_id'] = $request['game_id']; if(!empty($request['server_id'])) @@ -27,15 +30,14 @@ class GameGiftPageController extends BaseController{ ->select(); //遍历数据获取游戏图片地址 foreach ($list as $key => $val) { - $res = M('gift_record','tab_')->field('id')->where(['gift_id' => $val['id'],'user_id' => $this->user_id])->find(); + $res = M('gift_record','tab_')->field('id')->where(['gift_id' => $val['id'],'user_id' => $this->userId])->find(); if($res){ $list[$key]['received']=1; }else{ $list[$key]['received']=0; } - if($val['end_time'] != 0 && NOW_TIME > $val['end_time']) - { + if($val['end_time'] != 0 && NOW_TIME > $val['end_time']) { unset($list[$key]); } unset($list[$key]['novice']); diff --git a/Application/Sdk/Controller/UserHController.class.php b/Application/Sdk/Controller/UserHController.class.php index c70946b6..63cb5b8c 100644 --- a/Application/Sdk/Controller/UserHController.class.php +++ b/Application/Sdk/Controller/UserHController.class.php @@ -11,9 +11,12 @@ class UserHController extends BaseController * 获取用户平台币充值记录绑币余额 * @return [type] [description] */ - public function get_user_money() + public function get_user_money() { $data = json_decode(base64_decode(file_get_contents("php://input")), true); + if (I("debug") == 1) { + $data['user_token'] = 'b9c9739f7e3dc0b338dc3f4a4f02cb29'; + } $user_info = M('user','tab_')->where(['user_token' => $data['user_token']])->field('id,account,balance')->find(); $user_play = M('user_play','tab_')->alias('user') @@ -37,10 +40,12 @@ class UserHController extends BaseController { $deposit[$k]['create_time'] = date('Y-m-d',$v['create_time']); } - $this->assign('account',$user_info['account']); - $this->assign('balance',$user_info['balance']); - $this->assign('deposit',$deposit); - $this->assign('user_play',$user_play); + $this->assign('account', $user_info['account']); + $this->assign('balance', $user_info['balance']?:0); + $this->assign('deposit', $deposit); + $this->assign('user_play', $user_play); + $this->assign('user_token', $data['user_token']); + $this->display(); } @@ -49,21 +54,22 @@ class UserHController extends BaseController * 填写充值 */ - public function file_pay($account) + public function file_pay() { - $this->assign('account',$account); + $u = M('user', 'tab_')->where(['id' => $this->userId])->find(); + $this->assign("account", $u['account']); + $this->assign("user_token", $u['user_token']); $this->display('file_pay'); } public function pay() { + $u = M('user', 'tab_')->where(['id' => $this->userId])->find(); $post = I('post.'); - - if(empty($post['money'])) - { + if(empty($post['money'])) { $this->error('金额不能为空'); } - $this->assign('account',$post['account']); + $this->assign("account", $u['account']); $this->assign('money',$post['money']); $this->display('pay'); } diff --git a/Application/Sdk/View/default/UserH/file_pay.html b/Application/Sdk/View/default/UserH/file_pay.html index f061b8cc..bd91d70e 100644 --- a/Application/Sdk/View/default/UserH/file_pay.html +++ b/Application/Sdk/View/default/UserH/file_pay.html @@ -15,7 +15,7 @@