|
@@ -81,11 +81,20 @@ class UserBank extends Model
|
|
public static function edit($params)
|
|
public static function edit($params)
|
|
{
|
|
{
|
|
$user = User::info();
|
|
$user = User::info();
|
|
-
|
|
|
|
extract($params);
|
|
extract($params);
|
|
$bank = self::where(['user_id' => $user->id, 'type' => $type])->find();
|
|
$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) {
|
|
if ($bank) {
|
|
$bank->real_name = $real_name;
|
|
$bank->real_name = $real_name;
|
|
$bank->bank_name = $bank_name;
|
|
$bank->bank_name = $bank_name;
|