Просмотр исходного кода

开启消息队列之后,企业微信机器人消息无法发送的问题处理

evoxwht 2 лет назад
Родитель
Сommit
ffe93cd369

+ 6 - 2
crmeb/app/adminapi/controller/v1/setting/SystemNotification.php

@@ -34,8 +34,10 @@ class SystemNotification extends AuthController
 
     /**
      * 显示资源列表
-     *
      * @return \think\Response
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function index()
     {
@@ -47,8 +49,10 @@ class SystemNotification extends AuthController
 
     /**
      * 显示编辑
-     *
      * @return \think\Response
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function info()
     {

+ 5 - 4
crmeb/app/listener/notice/NoticeListener.php

@@ -70,6 +70,7 @@ class NoticeListener implements ListenerInterface
                     case 'bind_spread_uid':
                         if (isset($data['spreadUid']) && $data['spreadUid']) {
                             $name = $data['nickname'] ?? '';
+                            crmebLog('绑定推广关系');
                             //站内信
                             $SystemMsg->sendMsg($data['spreadUid'], ['nickname' => $name]);
                             //模板消息公众号模版消息
@@ -354,7 +355,7 @@ class NoticeListener implements ListenerInterface
                         $link = '/pages/admin/orderDetail/index?id=' . $order['order_id'];
                         $WechatTemplateList->sendAdminOrder($order['order_id'], $storeName, $title, $status, $link);
                         //企业微信通知
-                        EnterpriseWechatJob::dispatch(['order_id' => $order['order_id']]);
+                        $EnterpriseWechat->weComSend(['order_id' => $order['order_id']]);
                         break;
                     //确认收货给客服
                     case 'send_admin_confirm_take_over':
@@ -371,7 +372,7 @@ class NoticeListener implements ListenerInterface
                         $link = '/pages/admin/orderDetail/index?id=' . $order['order_id'];
                         $WechatTemplateList->sendAdminOrder($order['order_id'], $storeName, $title, $status, $link);
                         //企业微信通知
-                        EnterpriseWechatJob::dispatch(['storeTitle' => $storeTitle, 'order_id' => $order['order_id']]);
+                        $EnterpriseWechat->weComSend(['storeTitle' => $storeTitle, 'order_id' => $order['order_id']]);
                         break;
                     //申请退款给客服发消息
                     case 'send_order_apply_refund':
@@ -381,7 +382,7 @@ class NoticeListener implements ListenerInterface
                         //短信
                         $NoticeSms->sendAdminRefund($order);
                         //企业微信通知
-                        EnterpriseWechatJob::dispatch(['order_id' => $order['order_id']]);
+                        $EnterpriseWechat->weComSend(['order_id' => $order['order_id']]);
                         //公众号
                         $storeName = $orderInfoServices->getCarIdByProductTitle((int)$order['id']);
                         $title = '亲,您有个退款订单待处理!';
@@ -394,7 +395,7 @@ class NoticeListener implements ListenerInterface
                         //站内信
                         $SystemMsg->kefuSystemSend($data);
                         //企业微信通知
-                        EnterpriseWechatJob::dispatch($data);
+                        $EnterpriseWechat->weComSend($data);
                         break;
                 }
 

+ 5 - 0
crmeb/app/services/activity/lottery/LuckLotteryServices.php

@@ -400,6 +400,11 @@ class LuckLotteryServices extends BaseServices
      * 抽奖
      * @param int $uid
      * @param int $lottery_id
+     * @return mixed
+     * @throws \Psr\SimpleCache\InvalidArgumentException
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function luckLottery(int $uid, int $lottery_id)
     {