Base.php 830 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
  4. * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
  5. * @author pillar<ltmn@qq.com>
  6. * API服务
  7. */
  8. namespace app\system\controller\api;
  9. use app\common\controller\Api;
  10. use app\common\model\SystemUser;
  11. class Base extends Api{
  12. /**
  13. * 邀请用户判断
  14. * @return void
  15. */
  16. protected function getUCodeUser(){
  17. $ucode = de_code(strtoupper($this->request->param('ucode/s')));
  18. if(empty($ucode)){
  19. return json(['code'=>204,'msg'=>'邀请码为空']);
  20. }
  21. $result = SystemUser::where(['id'=> $ucode])->field('nickname,invite_code,face')->find();
  22. if(empty($result)){
  23. return enjson(204);
  24. }
  25. return enjson(200,$result);
  26. }
  27. }