You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
50 lines
1.1 KiB
4 months ago
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace app\Common\service;
|
||
|
|
||
|
|
||
|
use app\Common\model\LongbingUser;
|
||
|
|
||
|
class LongbingUserService
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @param $userId
|
||
|
* @功能说明:获取用户openid
|
||
|
* @author jingshuixian
|
||
|
* @DataTime: 2020/1/14 12:02
|
||
|
*/
|
||
|
public static function getUserOpenId($userId){
|
||
|
$user = new LongbingUser();
|
||
|
$openid = $user->where(['id'=>$userId])->value('openid');
|
||
|
|
||
|
return $openid;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param $userId
|
||
|
* @功能说明:根据用户ID获得用户昵称
|
||
|
* @author jingshuixian
|
||
|
* @DataTime: 2020/2/27 11:48
|
||
|
*/
|
||
|
public static function getUserNickNameOpenId($userId){
|
||
|
$user = new LongbingUser();
|
||
|
$nickName = $user->where(['id'=>$userId])->value('nickName');
|
||
|
return $nickName;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param $userId
|
||
|
* @功能说明:判断用户是否存在
|
||
|
* @author jingshuixian
|
||
|
* @DataTime: 2020/1/16 14:58
|
||
|
*/
|
||
|
public static function isUser($uniacid ,$userId){
|
||
|
$user = new LongbingUser();
|
||
|
$info = $user->where(['uniacid' => $uniacid ])->find($userId);
|
||
|
|
||
|
return $info ? true : false ;
|
||
|
}
|
||
|
}
|