Skip to content

Commit

Permalink
feat(app): 增加 UserModel 服务
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed Feb 22, 2023
1 parent 2ea9c59 commit 060020b
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/.phpstorm.meta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace PHPSTORM_META {

use Miaoxing\Plugin\Service\User;

override(User::cur(), map([
'' => \Miaoxing\App\Service\UserModel::class,
]));
}
45 changes: 45 additions & 0 deletions src/Metadata/UserTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace Miaoxing\App\Metadata;

/**
* @property string|null $id
* @property string $appId
* @property string $outId
* @property int $adminType 管理员类型
* @property string $groupId 用户组
* @property bool $isAdmin
* @property string $nickName
* @property string $remarkName
* @property string $username
* @property string $name
* @property string $email
* @property string $mobile
* @property string|null $mobileVerifiedAt 手机校验时间
* @property string $phone
* @property string $password
* @property int $sex
* @property string $country
* @property string $province
* @property string $city
* @property string $district
* @property string $address
* @property string $signature
* @property bool $isEnabled 是否启用
* @property string $avatar
* @property string|null $lastLoginAt
* @property string|null $createdAt
* @property string|null $updatedAt
* @property string $createdBy
* @property string $updatedBy
* @property int $score 积分
* @property string $money 账户余额
* @property string $rechargeMoney 充值账户余额
* @property string $source 用户来源
* @property mixed $isMobileVerified
* @property string|null $displayName
* @internal will change in the future
*/
trait UserTrait
{
}
20 changes: 20 additions & 0 deletions src/Service/UserModel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Miaoxing\App\Service;

use Miaoxing\Admin\Service\GroupModel;
use Miaoxing\App\Metadata\UserTrait;
use Miaoxing\Plugin\Service\UserModel as BaseUserModel;

/**
* @property GroupModel $group
*/
class UserModel extends BaseUserModel
{
use UserTrait;

public function group()
{
return $this->hasOne(GroupModel::class, 'id', 'groupId');
}
}

0 comments on commit 060020b

Please sign in to comment.