You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.1 KiB
PHTML
70 lines
2.1 KiB
PHTML
5 years ago
|
<?php
|
||
|
|
||
|
namespace Sdk\Controller;
|
||
|
|
||
|
use Think\Controller;
|
||
|
use Think\Log;
|
||
|
|
||
|
class UserHController extends BaseController
|
||
|
{
|
||
|
/**
|
||
|
* 获取用户平台币充值记录绑币余额
|
||
|
* @return [type] [description]
|
||
|
*/
|
||
|
public function get_user_money()
|
||
|
{
|
||
|
$data = json_decode(base64_decode(file_get_contents("php://input"),true));
|
||
|
$user_info = M('user','tab_')->where(['user_token' => $data['user_token']])->field('id,account,balance')->find();
|
||
|
|
||
|
$user_play = M('user_play','tab_')->alias('user')
|
||
|
->join('tab_game as game on user.game_id = game.id')
|
||
|
->where(['user_id' => $user_info['id']])
|
||
|
->field('user.game_name,user.bind_balance,game.cover')->select();
|
||
|
foreach($user_play as $k => $v)
|
||
|
{
|
||
|
$cover = get_cover($v['cover'],'path');
|
||
|
if(strpos($cover, 'http')!==false){
|
||
|
$cover = $cover;
|
||
|
}else{
|
||
|
$cover = is_https()?'https://':'http://'.$_SERVER['HTTP_HOST'].$cover;
|
||
|
}
|
||
|
$user_play[$k]['cover'] = $cover;
|
||
|
}
|
||
|
$deposit = M('deposit','tab_')->where(['user_id' => $user_info['id'],'pay_status' => 1])
|
||
|
->field('user_account,create_time,pay_amount')->select();
|
||
|
|
||
|
foreach($deposit as $k => $v)
|
||
|
{
|
||
|
$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->display('balance');
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 填写充值
|
||
|
*/
|
||
|
|
||
|
public function file_pay($account)
|
||
|
{
|
||
|
$this->assign('account',$account);
|
||
|
$this->display('file_pay');
|
||
|
}
|
||
|
|
||
|
public function pay()
|
||
|
{
|
||
|
$post = I('post.');
|
||
|
|
||
|
if(empty($post['money']))
|
||
|
{
|
||
|
$this->error('金额不能为空');
|
||
|
}
|
||
|
$this->assign('account',$post['account']);
|
||
|
$this->assign('money',$post['money']);
|
||
|
$this->display('pay');
|
||
|
}
|
||
|
}
|