WeiBanQrcode.php 954 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php namespace App\Http\Controllers\Api;
  2. use App\Http\Controllers\Api\Api;
  3. use App\Models\Custom as Custom;
  4. use App\Models\WeiBan\Qrcode as Model;
  5. /**
  6. *微伴客服
  7. *
  8. * @author 刘相欣
  9. *
  10. * */
  11. class WeiBanQrcode extends Api{
  12. /**
  13. * 获取客服二维码 /api/weiban_qrcode/get_qrcode
  14. *
  15. *
  16. * */
  17. public function get_qrcode(Model $Model,Custom $Custom){
  18. // 接口验签
  19. // $this->verify_sign();
  20. // 检查登录
  21. $uid = $this->checkLogin();
  22. // 查询用户
  23. $custom = $Custom->getOne($uid);
  24. // 用户不存在
  25. if( empty($custom) ) return json_send(['code'=>'error','msg'=>'用户不存在','data'=>['error'=>'用户不存在']]);
  26. // 如果没有关联企微,获取二维码,已关联的不验证
  27. $followQrcode = $Model->getFollowQrcode($custom['city_id']);
  28. // 返回结果
  29. return json_send(['code'=>'success','msg'=>'获取成功','data'=>['follow_qrcode'=>$followQrcode]]);
  30. }
  31. }