| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace biz\common\classes;
- use biz\base\classes\BaseClass;
- use common\components\noticeUtil;
- use Yii;
- class HdNotifyClass extends BaseClass
- {
- public static function newOrderNotify($orderId)
- {
- try {
- $producer = Yii::$app->rabbitmq->getProducer('notifyProducer');
- $msg = serialize(['type' => 'hd_new_order_notify', 'orderId' => $orderId]);
- $producer->publish($msg, 'notifyExchange', 'notifyRoute');
- } catch (\Exception $e) {
- $msg = $e->getMessage();
- $remind = "花店新订单通知,生产消息报错 {$orderId} {$msg}";
- noticeUtil::push($remind, '15280215347');
- }
- }
- public static function newCgNotify($cgId)
- {
- try {
- $producer = Yii::$app->rabbitmq->getProducer('notifyProducer');
- $msg = serialize(['type' => 'hd_new_cg_notify', 'cgId' => $cgId]);
- $producer->publish($msg, 'notifyExchange', 'notifyRoute');
- } catch (\Exception $e) {
- $msg = $e->getMessage();
- $remind = "花店新采购单通知,生产消息报错 {$cgId} {$msg}";
- noticeUtil::push($remind, '15280215347');
- }
- }
- }
|