Live.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <?php
  2. namespace app\sys\controller;
  3. use app\model\Company;
  4. use app\model\CompanyBossOpen;
  5. use app\logics\Unionaccount;
  6. use think\facade\View;
  7. use think\Cache;
  8. class Live
  9. {
  10. public function dashbordbaseinfo_allbase(){
  11. $cid = input('cid');
  12. // 获取分页相关参数
  13. $url = 'https://'.config('app.bosslive_domain').'/saasapi/dashbordbaseinfo/allbase?cid='.$cid;
  14. $cmunionid = $this->getcmucode();
  15. $data = curlparam($url,$cmunionid);
  16. // 返回数据
  17. return json_decode($data,true);
  18. }
  19. public function dashboard_rankList(){
  20. $page = input('page');
  21. // 获取分页相关参数
  22. $url = 'https://'.config('app.bosslive_domain').'/saasapi/dashboard/rankList?page='.$page;
  23. $cmunionid = $this->getcmucode();
  24. $data = curlparam($url,$cmunionid);
  25. // 返回数据
  26. return json_decode($data,true);
  27. }
  28. public function api_vod_currentstreams(){
  29. $cmcode = input('cmcode');
  30. // 获取分页相关参数
  31. $url = 'https://'.config('app.bosslive_domain').'/saasapi/vod/currentstreams/?cmcode='.$cmcode;
  32. $cmunionid = $this->getcmucode();
  33. $data = curlparam($url,$cmunionid);
  34. // 返回数据
  35. return json_decode($data,true);
  36. }
  37. //////////////////////
  38. public function api_goods_liveindex(){
  39. $cmcode = input('cmcode');
  40. $ctoken = input('ctoken');
  41. //$cid = Cache::get('cid_by_ctoken_'.$ctoken); //3小时过期
  42. //$url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/liveIndex/?cid='.$cid;
  43. // 获取分页相关参数
  44. $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/liveIndex/?cmcode='.$cmcode.'&ctoken='.$ctoken;
  45. $cmunionid = $this->getcmucode();
  46. $data = curlparam($url,$cmunionid);
  47. // 返回数据
  48. return json_decode($data,true);
  49. }
  50. public function api_waistcoat_waistcoats(){
  51. $cmid = input('cmid');
  52. $page = input('page');
  53. // 获取分页相关参数
  54. $url = 'https://'.config('app.bosslive_domain').'/saasapi/waistcoat/waistcoats/?cmid='.$cmid.'&page='.$page;
  55. $cmunionid = $this->getcmucode();
  56. $data = curlparam($url,$cmunionid);
  57. // 返回数据
  58. return json_decode($data,true);
  59. }
  60. public function api_waistcoat_waistcoatfikeorders(){
  61. $cid = input('cid');
  62. // 获取分页相关参数
  63. $url = 'https://'.config('app.bosslive_domain').'/saasapi/waistcoat/waistcoats/?cid='.$cid;
  64. $cmunionid = $this->getcmucode();
  65. $data = curlparam($url,$cmunionid);
  66. // 返回数据
  67. return json_decode($data,true);
  68. }
  69. public function api_chat_logs_commentlist(){
  70. $ctoken = input('ctoken');
  71. $page = input('page');
  72. // 获取分页相关参数
  73. $url = 'https://'.config('app.bosslive_domain').'/saasapi/chat_logs/commentList/?ctoken='.$ctoken.'&page='.$page;
  74. $cmunionid = $this->getcmucode();
  75. $data = curlparam($url,$cmunionid);
  76. // 返回数据
  77. return json_decode($data,true);
  78. }
  79. public function api_chat_logs_wcommentlist(){
  80. $cid = input('cid');
  81. $page = input('page');
  82. // 获取分页相关参数
  83. $url = 'https://'.config('app.bosslive_domain').'/saasapi/chat_logs/wcommentList/?cid='.$cid.'&page='.$page;
  84. $cmunionid = $this->getcmucode();
  85. $data = curlparam($url,$cmunionid);
  86. // 返回数据
  87. return json_decode($data,true);
  88. }
  89. public function chat_deleteByUuid(){
  90. $uuid = input('uuid');
  91. // 获取分页相关参数
  92. $url = 'https://'.config('app.bosslive_domain').'/saasapi/chat/deleteByUuid/?uuid='.$uuid;
  93. $cmunionid = $this->getcmucode();
  94. $data = curlparam($url,$cmunionid);
  95. // 返回数据
  96. return json_decode($data,true);
  97. }
  98. public function chat_delete(){
  99. $id = input('id');
  100. // 获取分页相关参数
  101. $url = 'https://'.config('app.bosslive_domain').'/saasapi/chat/delete/?id='.$id;
  102. $cmunionid = $this->getcmucode();
  103. $data = curlparam($url,$cmunionid);
  104. // 返回数据
  105. return $data;
  106. }
  107. public function blacklist_add(){
  108. $uuid = input('uuid');
  109. // 获取分页相关参数
  110. $url = 'https://'.config('app.bosslive_domain').'/saasapi/blacklist/add/?uuid='.$uuid;
  111. $cmunionid = $this->getcmucode();
  112. $data = curlparam($url,$cmunionid);
  113. // 返回数据
  114. return json_decode($data,true);
  115. }
  116. public function blacklist_add_two(){
  117. $uuid = input('uuid');
  118. // 获取分页相关参数
  119. $url = 'https://'.config('app.bosslive_domain').'/saasapi/blacklist/add/?uuid='.$uuid;
  120. $cmunionid = $this->getcmucode();
  121. $data = curlparam($url,$cmunionid);
  122. // 返回数据
  123. return $data;
  124. }
  125. public function blacklist_del(){
  126. $uid = input('uid');
  127. // 获取分页相关参数
  128. $url = 'https://'.config('app.bosslive_domain').'/saasapi/blacklist/del/?uid='.$uid;
  129. $cmunionid = $this->getcmucode();
  130. $data = curlparam($url,$cmunionid);
  131. // 返回数据
  132. return $data;
  133. }
  134. private function getcmucode(){
  135. $request = request();
  136. $root_id = $request->employee->root_id;
  137. $companybossopen = CompanyBossOpen::where(['root_id'=>$root_id])->find();
  138. $cmunionid = $companybossopen->unionid;
  139. return $cmunionid;
  140. }
  141. }