|
|
@@ -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);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|