HandleMqService.php 824 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace addons\YunfastPay\common\services;
  3. use Exception;
  4. use Yii;
  5. /**
  6. * Mq队列处理
  7. * HandleMqService class
  8. * @package addons\YunfastPay\common\services
  9. */
  10. class HandleMqService
  11. {
  12. /**
  13. * 处理门店分账代付
  14. *
  15. * @param array $data
  16. * [
  17. * id => int,
  18. * mall_id => int,
  19. * store_id => int,
  20. * ]
  21. * @return void
  22. */
  23. public static function handleStoreAgent($data)
  24. {
  25. $id = $data['id'];
  26. $mall_id = $data['mall_id'];
  27. $service = new StoreService(['mall_id' => $mall_id]);
  28. try {
  29. $service->agentBySplitBillLogId($id);
  30. } catch (Exception $e) {
  31. $message = sprintf('门店分账失败: $s, $s', $e->getLine(), $e->getMessage());
  32. Yii::error($message);
  33. }
  34. }
  35. }