更新
This commit is contained in:
parent
15729aacd7
commit
2ed0f06c6f
@ -77,7 +77,7 @@ class WechatUserService
|
||||
|
||||
$this->user = $user;
|
||||
if(!$user->isEmpty()){
|
||||
$this->user->supplier=Supplier::where('uid',$user['id'])->field('id,mer_name')->find();
|
||||
$this->user->supplier=Supplier::where('uid',$user['id'])->with('userAuth')->field('id,mer_name')->find();
|
||||
}
|
||||
// $this->user->merchat=Merchant::where('uid',$user['id'])->find();
|
||||
return $this;
|
||||
|
6
app/common/cache/UserTokenCache.php
vendored
6
app/common/cache/UserTokenCache.php
vendored
@ -74,12 +74,12 @@ class UserTokenCache extends BaseCache
|
||||
|
||||
$user = User::where('id', '=', $userSession->user_id)
|
||||
->find();
|
||||
$merchant=Merchant::where('uid',$userSession->user_id)->find();
|
||||
$supplier=Supplier::where('uid',$userSession->user_id)->find();
|
||||
// $merchant=Merchant::where('uid',$userSession->user_id)->find();
|
||||
$supplier=Supplier::where('uid',$userSession->user_id)->with('userAuth')->find();
|
||||
$userInfo = [
|
||||
'user_id' => $user->id,
|
||||
'nickname' => $user->nickname,
|
||||
'merchant' => $merchant,
|
||||
// 'merchant' => $merchant,
|
||||
'supplier' => $supplier,
|
||||
'token' => $token,
|
||||
'mobile' => $user->mobile,
|
||||
|
@ -4,6 +4,7 @@ namespace app\common\model\supplier;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\model\user\UserAuth;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
@ -18,5 +19,8 @@ class Supplier extends BaseModel
|
||||
protected $name = 'supplier';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
public function userAuth()
|
||||
{
|
||||
return $this->hasOne(UserAuth::class, 'id', 'uid')->bind(['openid']);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user