GhsNotifyClass.php 740 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace biz\common\classes;
  3. use biz\base\classes\BaseClass;
  4. use common\components\noticeUtil;
  5. use Yii;
  6. class GhsNotifyClass extends BaseClass
  7. {
  8. //供货商新订单通知 ssh 20251202
  9. public static function newOrderNotify($orderId)
  10. {
  11. try {
  12. $producer = Yii::$app->rabbitmq->getProducer('notifyProducer');
  13. $msg = serialize(['type' => 'ghs_new_order_notify', 'orderId' => $orderId]);
  14. $producer->publish($msg, 'notifyExchange', 'notifyRoute');
  15. } catch (\Exception $e) {
  16. $msg = $e->getMessage();
  17. $remind = "供货商新订单通知,生产消息报错 {$orderId} {$msg}";
  18. noticeUtil::push($remind, '15280215347');
  19. }
  20. }
  21. }