From d73595302aa467c1ddbc52e20ed03752008b7751 Mon Sep 17 00:00:00 2001
From: wanghongjun <1445693971@qq,com>
Date: Tue, 5 Sep 2023 11:13:11 +0800
Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=81=94=E7=B3=BB=E5=AE=A2?=
=?UTF-8?q?=E6=9C=8D=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controller/Index.php | 10 ----------
app/controller/User.php | 18 ++++++++++++++++++
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/app/controller/Index.php b/app/controller/Index.php
index b07dc9e..db18755 100644
--- a/app/controller/Index.php
+++ b/app/controller/Index.php
@@ -9,16 +9,6 @@ use think\facade\Request;
class Index extends BaseController
{
- public function index()
- {
- return '
:)
ThinkPHP V' . \think\facade\App::version() . '
14载初心不改 - 你值得信赖的PHP框架
[ V6.0 版本由 亿速云 独家赞助发布 ] ';
- }
-
- public function hello($name = 'ThinkPHP6')
- {
- return 'hello,' . $name;
- }
-
/**
* 轮播图
*/
diff --git a/app/controller/User.php b/app/controller/User.php
index ae95946..bafb303 100644
--- a/app/controller/User.php
+++ b/app/controller/User.php
@@ -2,6 +2,7 @@
namespace app\controller;
use app\BaseController;
+use app\model\CustomerService as CustomerServiceModel;
use app\model\User as UserModel;
use app\validate\User as UserValidate;
use think\exception\ValidateException;
@@ -188,4 +189,21 @@ class User extends BaseController
return $this->renderSuccess('数据返回成功',['data' => $info]);
}
+
+ /**
+ * 返回用户联系客服信息
+ * @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
+ */
+ public function getCustomerServiceList()
+ {
+ $where = [];
+ $CustomerServiceModel = new CustomerServiceModel();
+ # 查询用户列表
+ $field = 'id,name,wx_number';
+ $list = $CustomerServiceModel->field($field)->where($where)->order('id desc')->select()->toArray();
+ return $this->renderSuccess('数据返回成功', ['list' => $list]);
+ }
}
\ No newline at end of file