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

19 lines
624 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
{
2023-09-18 17:04:42 +08:00
$field = ['id','user_phone','user_avatar','user_name','user_gender','user_age','user_status','user_last_login_time','user_last_login_ip','create_time'];
2023-09-18 09:11:13 +08:00
$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();
}
}