From 28937dd832c3d07aa870cff98fc4436d914eb586 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 8 Oct 2019 09:24:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=98=BE=E7=A4=BA=E5=AE=89=E5=8D=93=20save?= =?UTF-8?q?=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/Controller/UserController.class.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index 61c119ab2..103277845 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -1774,6 +1774,15 @@ class UserController extends BaseController if (isset($r['shortcut']) && $r['shortcut'] == 1) $shortcut_pay = 1; } + // 双乾微信小程序支付 + $wx_small = 0; + $sqpay = M('tool','tab_')->field('status, config')->where(array('name'=>'sqpay'))->find(); + if ($sqpay['status'] == 1) { + $r = json_decode($sqpay['config'], true); + if (isset($r['wx_small']) && $r['wx_small'] == 1) + $wx_small = 1; + } + $user_id = $request['user_id']; $game_id = $request['game_id']; $balance = M ('user', 'tab_')->where (array( @@ -1799,8 +1808,8 @@ class UserController extends BaseController 'squnion_pay' => $squnion_pay, // 银联0关 1开 'platform_coin' => $balance, 'bind_coin' => $bind_balance, - 'wx_type' => 0, // 0微信 1 微信小程序 双乾 - 'shortcut_pay' => 0, // 快捷支付 0关 1开 + 'wx_type' => $wx_small, // 0微信 1 微信小程序 双乾 + 'shortcut_pay' => $shortcut_pay, // 快捷支付 0关 1开 ))); } @@ -2015,10 +2024,8 @@ class UserController extends BaseController } $return = M('User', 'tab_') -> where($map) -> save($data); - if (!$return) { - + if ($return === false) { $this -> set_message(1070, "fail", "用户数据更新失败"); - } $data['status'] = 200; echo base64_encode(json_encode($data));