Browse Source

Merge branch '0927-community-bind' into master

master
weigang 5 years ago
parent
commit
177ba570b3
  1. 5
      app/Model/v3/User.php
  2. 4
      app/Service/v3/Implementations/WxLoginService.php

5
app/Model/v3/User.php

@ -34,4 +34,9 @@ class User extends Model
'gender',
'language',
];
public function community()
{
return $this->hasOne(CsInfo::class, 'user_id', 'id');
}
}

4
app/Service/v3/Implementations/WxLoginService.php

@ -5,6 +5,7 @@ namespace App\Service\v3\Implementations;
use App\Constants\v3\ErrorCode;
use App\Constants\v3\SsdbKeys;
use App\Exception\ErrorCodeException;
use App\Model\v3\CsInfo;
use App\Model\v3\User;
use App\TaskWorker\SSDBTask;
use EasyWeChat\Factory;
@ -43,6 +44,9 @@ class WxLoginService implements \App\Service\v3\Interfaces\WxLoginServiceInterfa
$ssdb->exec('setnx', $hashIds, 1);
$ssdb->exec('expire', $hashIds, config('auth.user.expire_time'));
$sourceId = CsInfo::query()->where(['user_id' => $user['id']])->value('admin_user_id');
$user['community_source_id'] = $sourceId ?: 0;
$return = array_merge($user, $result);
$kvs = [];

Loading…
Cancel
Save