shish 6 年 前
コミット
367368ed59
1 ファイル変更13 行追加7 行削除
  1. 13 7
      app/mall/controllers/TestController.php

+ 13 - 7
app/mall/controllers/TestController.php

@@ -2,20 +2,26 @@
 
 namespace mall\controllers;
 
+use biz\merchant\services\MerchantService;
 use biz\message\services\InformAdminService;
+use biz\order\services\OrderService;
 use common\components\util;
 use Yii;
 
 class TestController extends BaseController
 {
-	
+
+	public $withoutLogin = ['rabbit'];
+
 	public function actionRabbit()
 	{
-		InformAdminService::addInform(12358, 15680, 'goodsSold', ['price' => 20]);
-		util::end();
-		$producer = Yii::$app->rabbitmq->getProducer('producerCommon');
-		$msg = serialize(['user_id' => rand(111, 999)]);
-		$producer->publish($msg, 'exCommon', 'routeCommon');
+		$orderId = 214752;
+		$order = OrderService::getById($orderId);
+		$merchantId = $order['merchantId'];
+		$merchant = MerchantService::getMerchantById($merchantId);
+		$params = ['sourceType' => $order['sourceType'], 'miniAppId' => $merchant['miniAppId'], 'orderId' => $orderId];
+		$type = 'income';
+		InformAdminService::addInform($merchantId, $shopId, $type, $params);
 	}
-	
+
 }