19 lines
624 B
PHP
19 lines
624 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_phone','user_avatar','user_name','user_gender','user_age','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();
|
|
}
|
|
} |