vali 6 lat temu
rodzic
commit
3f8973901b
1 zmienionych plików z 163 dodań i 3 usunięć
  1. 163 3
      application/service/controller/Ext.php

+ 163 - 3
application/service/controller/Ext.php

@@ -5,6 +5,12 @@ namespace app\service\controller;
 use think\cache\driver\Redis;
 use think\Request;
 
+use app\admin\model\Advertisement;
+use app\admin\model\Users;
+use app\service\model\Accounts;
+use app\admin\model\Admins;
+use app\admin\model\ServiceLog;
+
 /**
  * 客服系统 Event 接口
  */
@@ -13,17 +19,171 @@ class Ext extends Common
     public function __construct(Request $request = null)
     {
         parent::__construct($request);
-
         // 验证token.
-        $this->verifyToken();
+        $this->doTokenCheck();
+    }
+
+    //获取广告数据
+    public function getAdinfo()
+    {
+        $model = new Advertisement();
+        $ret = $model->where('advertisement_status', 1)->select();
+        return json(['code' => 1, 'data' => $ret, 'msg' => '成功']);
+    }
+
+
+    //更具id获取客服信息
+    public function getKfbyid()
+    {
+        $id = intval(input('post.id', 0));
+        if (empty($id)) {
+            return json(['code' => 0, 'data' => [], 'msg' => '参数错误!']);;
+        }
+        $model = Users::get($id);
+        if ($model) {
+            return json(['code' => 1, 'data' => $model, 'msg' => '成功']);;
+        } else {
+            return json(['code' => 0, 'data' => [], 'msg' => '无此用户']);;
+        }
+    }
+
+    //更具id获取 用户 信息
+    public function getUserbyid()
+    {
+        $id = intval(input('post.id', 0));
+        if (empty($id)) {
+            return json(['code' => 0, 'data' => [], 'msg' => '参数错误!']);;
+        }
+        $model = Accounts::get($id);
+        if ($model) {
+            return json(['code' => 1, 'data' => $model, 'msg' => '成功']);;
+        } else {
+            return json(['code' => 0, 'data' => [], 'msg' => '无此用户']);;
+        }
+    }
+
+
+    //更具token 查管理员
+    public function getAdminbytoken()
+    {
+        $token = trim(input('post.token', ''));
+        if (empty($token)) {
+            return json(['code' => 0, 'data' => [], 'msg' => '参数错误!']);;
+        }
+        $model = new  Admins();
+        $model = $model->where('token', $token)->find();
+        if ($model) {
+            return json(['code' => 1, 'data' => $model, 'msg' => '成功']);;
+        } else {
+            return json(['code' => 0, 'data' => [], 'msg' => '无此用户']);;
+        }
+    }
+
+
+    //更具工单ID查工单
+    public function getServerbyid()
+    {
+        $id = intval(input('post.id', 0));
+        if (empty($id)) {
+            return json(['code' => 0, 'data' => [], 'msg' => '参数错误!']);;
+        }
+        $model = ServiceLog::get($id);
+        if ($model) {
+            return json(['code' => 1, 'data' => $model, 'msg' => '成功']);;
+        } else {
+            return json(['code' => 0, 'data' => [], 'msg' => '无此数据']);;
+        }
+    }
+
+
+    //
+    public function xx3()
+    {
+
+    }
+
+
+    //
+    public function xx4()
+    {
+
+    }
+
+
+    //
+    public function xx5()
+    {
+
+    }
+
+
+    //
+    public function xx6()
+    {
+
+    }
+
+
+    //
+    public function xx7()
+    {
+
+    }
+
+
+    //
+    public function xx8()
+    {
+
+    }
+
+
+    //
+    public function xx9()
+    {
+
     }
 
-    public function allConversation()
+
+    //
+    public function xxa()
     {
 
+    }
 
 
+    //
+    public function xxb()
+    {
+
     }
 
 
+    //
+    public function xxc()
+    {
+
+    }
+
+
+    //
+    public function xxd()
+    {
+
+    }
+
+
+    //
+    public function xxe()
+    {
+
+    }
+
+
+    //
+    public function xxf()
+    {
+
+    }
+
 }