getMessage()); } } /** * 分配客服 * @param Request $request * @return Response */ #[PostMapping("shareout")] public function shareUser2Mer(Request $request): Response { try { $param = $request->all(); $store = (new SaasStore)->where("poi_id",$param['poi'])->findOrEmpty(); if ($store->isEmpty()) return error("店铺不存在"); // 获取在线客服 $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]); // 无客服在线 return $this->encode("ok",['store' => $store,'code' => 1]); // 客服在线 } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }