shish 8 luni în urmă
părinte
comite
fd38b03a38
1 a modificat fișierele cu 11 adăugiri și 3 ștergeri
  1. 11 3
      app-ghs/controllers/TestController.php

+ 11 - 3
app-ghs/controllers/TestController.php

@@ -43,11 +43,19 @@ class TestController extends BaseController
 
     public $guestAccess = ['rabbit', 'recharge', 'fx', 'on', 'in', 'clear-query', 'ip', 'html', 'debt', 'apply', 'clear', 'ls-trade-query', 'ls-trade-refund', 'refund-query', 'inform', 'notice', 'order-query', 'add-order', 'index', 'get', 'trade-query', 'query', 'balance-query', 'refund', 'recharge-query', 'sim', 'push', 'code'];
 
+    // ./yii test/rabbit 0
     public function actionRabbit()
     {
-        $producer = Yii::$app->rabbitmq->getProducer('stockProducer');
-        $msg = serialize(['type' => 'add', 'name' => 'shish']);
-        $producer->publish($msg, 'stockExchange', 'stockRoute', ['delivery_mode' => 2, 'content_type' => 'application/octet-stream']);
+        global $argv;
+        $id = $argv[2] ?? 0;
+        $event = '跑腿已经取消';
+        if ($id == 0) {
+            $orderId = 5231;
+            GhsNotifyClass::ptErrorNotify($orderId, $event);
+        } else {
+            $orderId = 524419;
+            HdNotifyClass::ptErrorNotify($orderId, $event);
+        }
     }
 
     public function actionFx()