| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <?php
- 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 接口
- */
- class Ext extends Common
- {
- public function __construct(Request $request = null)
- {
- parent::__construct($request);
- // 验证token.
- $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 xxa()
- {
- }
- //
- public function xxb()
- {
- }
- //
- public function xxc()
- {
- }
- //
- public function xxd()
- {
- }
- //
- public function xxe()
- {
- }
- //
- public function xxf()
- {
- }
- }
|