UserInfoLogic.php 683 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace app\api\logic;
  3. use Exception;
  4. use think\Env;
  5. use think\Cache;
  6. use think\Loader ;
  7. use fast\Asset;
  8. use app\common\model\UserModel;
  9. //用户逻辑
  10. class UserInfoLogic
  11. {
  12. //判断用户手机号存在或者重复
  13. public static function checkUserByInfo(string $wher, int $user_id, string $wher2)
  14. {
  15. //用户信息存在
  16. $user = (new UserModel)->getById($user_id);
  17. if(!empty($user[$wher])) return false;
  18. $where = [];
  19. $where[$wher] = $wher2;
  20. $userInfo = UserModel::getByUserCount($where);
  21. if($userInfo > 1) return false;
  22. return true;
  23. }
  24. }