|
|
@@ -41,6 +41,7 @@ class notifyConsumer implements ConsumerInterface
|
|
|
print_r($data);
|
|
|
// 根据通知类型分发处理
|
|
|
$type = $data['type'] ?? null;
|
|
|
+ Yii::$app->db->open();//处理消息前确保连接可用
|
|
|
switch ($type) {
|
|
|
case 'ghs_new_order_notify':
|
|
|
//供货商的新订单通知
|
|
|
@@ -58,6 +59,7 @@ class notifyConsumer implements ConsumerInterface
|
|
|
noticeUtil::push("通知的消费者提示:Unknown notify type: {$type}", '15280215347');
|
|
|
$result = false;
|
|
|
}
|
|
|
+ Yii::$app->db->close(); // 处理完后关闭连接
|
|
|
if ($result) {
|
|
|
return ConsumerInterface::MSG_ACK;
|
|
|
} else {
|