| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace addons\Happiness\common\logic\notify;
- use addons\Happiness\common\models\HappinessCashierOrder;
- use common\enums\RabbitMqEnum;
- use common\traits\ErrorTrait;
- use Exception;
- class CashierNotify
- {
- use ErrorTrait;
-
- public function notify($order_info)
- {
- try {
- $order = HappinessCashierOrder::getOne([['order_no' => $order_info['order_no']]],true);
- $order['pay_type'] =$order_info['pay_type'];
- \Yii::$app->services->rabbitMq->push(RabbitMqEnum::EXCHANGE_ORDER, RabbitMqEnum::ORDER_QUEUE, $order, HappinessCashierOrder::class, 'pay');
- return true;
- } catch (Exception $e) {
- echo $e->getMessage();
- $this->setStaticError($e->getMessage());
- return false;
- }
- }
- }
|