1234567891011121314151617181920212223242526272829 |
- <?php
- namespace app\api\model;
- use think\Model;
- class UsersModel extends Model
- {
- protected $name = "Users";
- protected $rules = [
- 'user_id' => 'require|number',
- 'user_nickname' => 'require',
- 'idcard' => 'require',
- ];
- /**
- * 检查用户是否存在
- * @param $userId
- * @return bool
- * @throws \think\exception\DbException
- */
- public static function checkUserExist($userId)
- {
- $user = self::get($userId);
- if (!empty($user)) {
- return true;
- }
- return false;
- }
- }
|