data_center/app/adminapi/logic/user/UserLogic.php

19 lines
648 B
PHP
Raw Normal View History

2023-09-18 09:11:13 +08:00
<?php
namespace app\adminapi\logic\user;
use app\common\logic\BaseLogic;
use app\common\model\user\User;
class UserLogic extends BaseLogic
{
//用户详情
public static function detail(int $userId): array
{
$field = ['id','user_account','user_nickname','user_avatar','user_realname','user_gender','user_phone','user_status','user_last_login_time','user_last_login_ip','create_time'];
$user = User::field($field)->where(['id' => $userId])->findOrEmpty();
$user['user_gender_text'] = $user->user_gender_text;
$user['user_status_text'] = $user->user_status_text;
return $user->toArray();
}
}