|
|
|
@ -80,9 +80,27 @@ class UserHController extends Controller
|
|
|
|
|
if(!$money) {
|
|
|
|
|
$this->error('金额不能为空');
|
|
|
|
|
}
|
|
|
|
|
// if(!is_int($post['money'])) {
|
|
|
|
|
// $this->error('金额不能小于1');
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
$user_info = M('user', 'tab_')->field('account,promote_id,promote_account')->where(['id' => $this->userId])->find();
|
|
|
|
|
$game_name = M('game', 'tab_')->where(['id' => I('game_id')])->getField('game_name');
|
|
|
|
|
$out_trade_no = $prefix.date('Ymd').date('His').sp_random_string(4);
|
|
|
|
|
var_dump(I('get.'));exit;
|
|
|
|
|
$data = [
|
|
|
|
|
'user_id' => $this->userId,
|
|
|
|
|
'game_id' => I('game_id'),
|
|
|
|
|
'order_id' => $out_trade_no,
|
|
|
|
|
'price' => $money,
|
|
|
|
|
'type' => 'bind_pay',
|
|
|
|
|
'status' => 'normal',
|
|
|
|
|
'create_time' => time(),
|
|
|
|
|
'user_account' => $user_info['account'],
|
|
|
|
|
'game_name' => $game_name,
|
|
|
|
|
'promote_id' => $user_info['promote_id'],
|
|
|
|
|
'promote_account' => $user_info['promote_account'],
|
|
|
|
|
'sdk_version' => $api_ver,
|
|
|
|
|
'ip' => get_client_ip(),
|
|
|
|
|
];
|
|
|
|
|
M('pay_info', 'tab_')->add($data);
|
|
|
|
|
$this->assign('api_ver', $api_ver);
|
|
|
|
|
$this->assign("account", $u['account']);
|
|
|
|
|
$this->assign("user_id", $u['id']);
|
|
|
|
|