Master.php 666 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * 服务提供者
  5. * User: qissen
  6. * Date: 2017/6/7
  7. * Time: 7:36
  8. * 注意调用顺序,checkClientType,checkData必须先调用,才可以验证其他
  9. */
  10. namespace app\core\service;
  11. use app\core\model\Master as Model;
  12. use tool\Common;
  13. class Master
  14. {
  15. //发送验证码,手机号
  16. public static function getMasterByToken($token) {
  17. if(!$token) {
  18. return false;
  19. }
  20. $user = Model::with(['userAccount'])->where([
  21. 'token'=>$token
  22. ])->find();
  23. if($user['tokenOverTime'] < THINK_START_TIME) {
  24. return false;
  25. }
  26. return $user;
  27. }
  28. }