|
@@ -7,6 +7,7 @@ use app\middleware\AuthMiddleware;
|
|
|
use app\model\saas\SaasStore;
|
|
use app\model\saas\SaasStore;
|
|
|
use app\model\system\SystemUser;
|
|
use app\model\system\SystemUser;
|
|
|
use LinFly\Annotation\Attributes\Route\Controller;
|
|
use LinFly\Annotation\Attributes\Route\Controller;
|
|
|
|
|
+use LinFly\Annotation\Attributes\Route\GetMapping;
|
|
|
use LinFly\Annotation\Attributes\Route\Middleware;
|
|
use LinFly\Annotation\Attributes\Route\Middleware;
|
|
|
use LinFly\Annotation\Attributes\Route\PostMapping;
|
|
use LinFly\Annotation\Attributes\Route\PostMapping;
|
|
|
use support\Request;
|
|
use support\Request;
|
|
@@ -18,13 +19,28 @@ class Service extends Base
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取客服列表-已聊过的
|
|
|
|
|
+ * @param Request $request
|
|
|
|
|
+ * @return Response|void
|
|
|
|
|
+ */
|
|
|
|
|
+ #[GetMapping("list")]
|
|
|
|
|
+ public function getServiceList(Request $request)
|
|
|
|
|
+ {
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ } catch (\Throwable $throwable) {
|
|
|
|
|
+ return error($throwable->getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 分配客服
|
|
* 分配客服
|
|
|
* @param Request $request
|
|
* @param Request $request
|
|
|
* @return Response
|
|
* @return Response
|
|
|
*/
|
|
*/
|
|
|
#[PostMapping("shareout")]
|
|
#[PostMapping("shareout")]
|
|
|
- public function shareUser2Mer(Request $request)
|
|
|
|
|
|
|
+ public function shareUser2Mer(Request $request): Response
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
$param = $request->all();
|
|
$param = $request->all();
|
|
@@ -33,7 +49,7 @@ class Service extends Base
|
|
|
// 获取在线客服
|
|
// 获取在线客服
|
|
|
$service = (new SystemUser)->where("store_id",$param['poi'])->where("type",3)->where("is_line",1)->findOrEmpty();
|
|
$service = (new SystemUser)->where("store_id",$param['poi'])->where("type",3)->where("is_line",1)->findOrEmpty();
|
|
|
if ($service->isEmpty()) return $this->encode("ok",['store' => $store,'code' => 3]); // 无客服在线
|
|
if ($service->isEmpty()) return $this->encode("ok",['store' => $store,'code' => 3]); // 无客服在线
|
|
|
-
|
|
|
|
|
|
|
+ return $this->encode("ok",['store' => $store,'code' => 1]); // 客服在线
|
|
|
} catch (\Throwable $throwable) {
|
|
} catch (\Throwable $throwable) {
|
|
|
return error($throwable->getMessage());
|
|
return error($throwable->getMessage());
|
|
|
}
|
|
}
|