shish 7 meses atrás
pai
commit
3b45f84a7d
1 arquivos alterados com 15 adições e 10 exclusões
  1. 15 10
      app-ghs/controllers/TestController.php

+ 15 - 10
app-ghs/controllers/TestController.php

@@ -46,16 +46,21 @@ class TestController extends BaseController
     // ./yii test/rabbit 0
     public function actionRabbit()
     {
-        $get = Yii::$app->request->get();
-        $id = $get['id'] ?? 0;
-        $event = '跑腿已经取消了' . rand(1, 999);
-        if ($id == 0) {
-            $orderId = 5231;
-            GhsNotifyClass::ptErrorNotify($orderId, $event);
-        } else {
-            $orderId = 525111;
-            HdNotifyClass::ptErrorNotify($orderId, $event);
-        }
+//        $get = Yii::$app->request->get();
+//        $id = $get['id'] ?? 0;
+//        $event = '跑腿已经取消了' . rand(1, 999);
+//        if ($id == 0) {
+//            $orderId = 5231;
+//            GhsNotifyClass::ptErrorNotify($orderId, $event);
+//        } else {
+//            $orderId = 525111;
+//            HdNotifyClass::ptErrorNotify($orderId, $event);
+//        }
+
+        $producer = Yii::$app->rabbitmq->getProducer('customProducer');
+        $msg = serialize(['type' => 'pull_custom_from_other_shop', 'toShopId' => 7609, 'fromShopId' => 33904]);
+        $producer->publish($msg, 'customExchange', 'customRoute', ['delivery_mode' => 2, 'content_type' => 'application/octet-stream']);
+
     }
 
     public function actionFx()