19 lines
648 B
PHP
19 lines
648 B
PHP
|
<?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();
|
||
|
}
|
||
|
}
|