Ext.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <?php
  2. namespace app\service\controller;
  3. use think\cache\driver\Redis;
  4. use think\Request;
  5. use app\admin\model\Advertisement;
  6. use app\admin\model\Users;
  7. use app\service\model\Accounts;
  8. use app\admin\model\Admins;
  9. use app\admin\model\ServiceLog;
  10. /**
  11. * 客服系统 Event 接口
  12. */
  13. class Ext extends Common
  14. {
  15. public function __construct(Request $request = null)
  16. {
  17. parent::__construct($request);
  18. // 验证token.
  19. $this->doTokenCheck();
  20. }
  21. //获取广告数据
  22. public function getAdinfo()
  23. {
  24. $model = new Advertisement();
  25. $ret = $model->where('advertisement_status', 1)->select();
  26. return json(['code' => 1, 'data' => $ret, 'msg' => '成功']);
  27. }
  28. //更具id获取客服信息
  29. public function getKfbyid()
  30. {
  31. $id = intval(input('post.id', 0));
  32. if (empty($id)) {
  33. return json(['code' => 0, 'data' => [], 'msg' => '参数错误!']);;
  34. }
  35. $model = Users::get($id);
  36. if ($model) {
  37. return json(['code' => 1, 'data' => $model, 'msg' => '成功']);;
  38. } else {
  39. return json(['code' => 0, 'data' => [], 'msg' => '无此用户']);;
  40. }
  41. }
  42. //更具id获取 用户 信息
  43. public function getUserbyid()
  44. {
  45. $id = intval(input('post.id', 0));
  46. if (empty($id)) {
  47. return json(['code' => 0, 'data' => [], 'msg' => '参数错误!']);;
  48. }
  49. $model = Accounts::get($id);
  50. if ($model) {
  51. return json(['code' => 1, 'data' => $model, 'msg' => '成功']);;
  52. } else {
  53. return json(['code' => 0, 'data' => [], 'msg' => '无此用户']);;
  54. }
  55. }
  56. //更具token 查管理员
  57. public function getAdminbytoken()
  58. {
  59. $token = trim(input('post.token', ''));
  60. if (empty($token)) {
  61. return json(['code' => 0, 'data' => [], 'msg' => '参数错误!']);;
  62. }
  63. $model = new Admins();
  64. $model = $model->where('token', $token)->find();
  65. if ($model) {
  66. return json(['code' => 1, 'data' => $model, 'msg' => '成功']);;
  67. } else {
  68. return json(['code' => 0, 'data' => [], 'msg' => '无此用户']);;
  69. }
  70. }
  71. //更具工单ID查工单
  72. public function getServerbyid()
  73. {
  74. $id = intval(input('post.id', 0));
  75. if (empty($id)) {
  76. return json(['code' => 0, 'data' => [], 'msg' => '参数错误!']);;
  77. }
  78. $model = ServiceLog::get($id);
  79. if ($model) {
  80. return json(['code' => 1, 'data' => $model, 'msg' => '成功']);;
  81. } else {
  82. return json(['code' => 0, 'data' => [], 'msg' => '无此数据']);;
  83. }
  84. }
  85. //
  86. public function xx3()
  87. {
  88. }
  89. //
  90. public function xx4()
  91. {
  92. }
  93. //
  94. public function xx5()
  95. {
  96. }
  97. //
  98. public function xx6()
  99. {
  100. }
  101. //
  102. public function xx7()
  103. {
  104. }
  105. //
  106. public function xx8()
  107. {
  108. }
  109. //
  110. public function xx9()
  111. {
  112. }
  113. //
  114. public function xxa()
  115. {
  116. }
  117. //
  118. public function xxb()
  119. {
  120. }
  121. //
  122. public function xxc()
  123. {
  124. }
  125. //
  126. public function xxd()
  127. {
  128. }
  129. //
  130. public function xxe()
  131. {
  132. }
  133. //
  134. public function xxf()
  135. {
  136. }
  137. }