手机端用户信息添加公司信息
This commit is contained in:
parent
085324505f
commit
eb7855f721
@ -69,8 +69,12 @@ class UserLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function info(int $userId)
|
public static function info(int $userId)
|
||||||
{
|
{
|
||||||
$user = User::where(['id' => $userId])
|
$user = User::where(['id' => $userId])->with(['admin' => [
|
||||||
->field('id,sn,sex,account,password,nickname,real_name,avatar,mobile,create_time,user_money,income')
|
'company' => function ($query) {
|
||||||
|
$query->field('id,company_name');
|
||||||
|
}
|
||||||
|
]])
|
||||||
|
->field('id,sn,sex,account,password,nickname,real_name,avatar,mobile,create_time,user_money,income,admin_id')
|
||||||
->findOrEmpty();
|
->findOrEmpty();
|
||||||
$user['has_password'] = !empty($user['password']);
|
$user['has_password'] = !empty($user['password']);
|
||||||
$user['has_auth'] = self::hasWechatAuth($userId);
|
$user['has_auth'] = self::hasWechatAuth($userId);
|
||||||
|
@ -17,6 +17,7 @@ namespace app\common\model\user;
|
|||||||
|
|
||||||
|
|
||||||
use app\common\enum\user\UserEnum;
|
use app\common\enum\user\UserEnum;
|
||||||
|
use app\common\model\auth\Admin;
|
||||||
use app\common\model\BaseModel;
|
use app\common\model\BaseModel;
|
||||||
use app\common\service\FileService;
|
use app\common\service\FileService;
|
||||||
use think\model\concern\SoftDelete;
|
use think\model\concern\SoftDelete;
|
||||||
@ -172,5 +173,9 @@ class User extends BaseModel
|
|||||||
return $sn;
|
return $sn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function admin()
|
||||||
|
{
|
||||||
|
return $this->hasOne(Admin::class, 'id', 'admin_id')->field('id,name,company_id');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user