User.php 775 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\api\controller\tvuser;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. /**
  6. * 会员接口,使用自动注册的用户
  7. */
  8. class User extends Api
  9. {
  10. protected $noNeedLogin = [];
  11. protected $noNeedRight = '*';
  12. //用户详细资料
  13. public function userinfo(){
  14. $info = $this->auth->getUserinfo_tv();
  15. $this->success(__('success'),$info);
  16. }
  17. //获取绑定的用户
  18. public function get_bind_userid(){
  19. $bind_user = Db::name('user')->field('id,tv_userid,comefrom')->where('tv_userid',$this->auth->tv_userid)->where('id','NEQ',$this->auth->id)->where('comefrom',1)->find();
  20. $rs = 0;
  21. if(!empty($bind_user)){
  22. $rs = $bind_user['id'];
  23. }
  24. $this->success(1,$rs);
  25. }
  26. }