wupengfei 3 سال پیش
والد
کامیت
18942e5801
1فایلهای تغییر یافته به همراه12 افزوده شده و 3 حذف شده
  1. 12 3
      addons/shopro/model/UserBank.php

+ 12 - 3
addons/shopro/model/UserBank.php

@@ -81,11 +81,20 @@ class UserBank extends Model
     public static function edit($params)
     {
         $user = User::info();
-
         extract($params);
         $bank = self::where(['user_id' => $user->id, 'type' => $type])->find();
-
-
+        if ($type == 'wechat') {
+            $platform = request()->header('platform');
+            $userOauth = \addons\shopro\model\UserOauth::get([
+                'user_id' => $user->id,
+                'platform' => $platform
+            ]);
+            if ($userOauth) {
+                $real_name = $userOauth->nickname;
+                $bank_name = '微信用户';
+                $card_no  = $userOauth->openid;
+            }
+        }
         if ($bank) {
             $bank->real_name = $real_name;
             $bank->bank_name = $bank_name;