diff --git a/app/api/controller/user/UserController.php b/app/api/controller/user/UserController.php index 31f476a3..7f82e975 100644 --- a/app/api/controller/user/UserController.php +++ b/app/api/controller/user/UserController.php @@ -31,7 +31,8 @@ class UserController extends BaseApiController if ($result === false) { return $this->fail(UserLogic::getError()); } - return $this->success('绑定成功', [], 1, 1); + $data = UserLogic::info($this->userId); + return $this->success('绑定成功', $data, 1, 1); } diff --git a/app/api/logic/LoginLogic.php b/app/api/logic/LoginLogic.php index f68c8b4a..5e8650d3 100644 --- a/app/api/logic/LoginLogic.php +++ b/app/api/logic/LoginLogic.php @@ -25,7 +25,7 @@ use app\common\service\{ }; use app\common\model\user\{User, UserAuth}; use app\common\service\wechat\WeChatMnpService; -use think\facade\Db; + use Webman\Config; /** @@ -221,7 +221,7 @@ class LoginLogic extends BaseLogic */ public static function mnpLogin(array $params) { - Db::startTrans(); +// Db::startTrans(); try { //通过code获取微信 openid $response = (new WeChatMnpService())->getMnpResByCode($params['code']); @@ -229,21 +229,11 @@ class LoginLogic extends BaseLogic $userInfo = $userServer->getResopnseByUserInfo()->authUserLogin()->getUserInfo(); // 更新登录信息 self::updateLoginInfo($userInfo['id']); - //判断是不是员工 -// $userInfo['is_staff'] = 0; -// $userInfo['store_id'] = 0; -// if(isset($userInfo['mobile']) && $userInfo['mobile']){ -// $check = SystemStoreStaff::where('phone',$userInfo['mobile'])->find()??[]; -// if ($check){ -// $userInfo['is_staff'] = 1; -// $userInfo['store_id'] = $check['store_id']; -// } -// } - Db::commit(); +// Db::commit(); return $userInfo; } catch (\Exception $e) { - Db::rollback(); +// Db::rollback(); self::$error = $e->getMessage(); return false; } diff --git a/app/common/logic/PaymentLogic.php b/app/common/logic/PaymentLogic.php index 628fac19..852e8aa9 100644 --- a/app/common/logic/PaymentLogic.php +++ b/app/common/logic/PaymentLogic.php @@ -34,9 +34,9 @@ class PaymentLogic extends BaseLogic public static function pay($payWay, $from, $order, $terminal, $redirectUrl) { // 支付编号-仅为微信支付预置(同一商户号下不同客户端支付需使用唯一订单号) - $paySn = $order['number']; - if ($order['actual'] == 0) { - PayNotifyLogic::handle($from, $order['number']); + $paySn = $order['order_id']; + if ($order['pay_price'] == 0) { + PayNotifyLogic::handle($from, $order['order_id']); return ['pay_way' => PayEnum::BALANCE_PAY]; } switch ($payWay) { @@ -46,11 +46,11 @@ class PaymentLogic extends BaseLogic 'out_trade_no' => $paySn, 'description' => '商品', 'amount' => [ - 'total' => intval($order['actual'] * 100), + 'total' => intval($order['pay_price'] * 100), 'currency' => 'CNY', ], "payer" => [ - "openid" => $auth['openid'] ?? 0 + "openid" => $auth['openid'] ?? 'onoIP7c1qgjfIr2ce7GJAAmVGcL0' ], 'attach' => $from ];