| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace app\queue\redis\slow;
- use app\extra\dyLife\data\OrderData;
- use app\model\saas\SaasOrder;
- use Webman\RedisQueue\Consumer;
- class AuditOrder implements Consumer
- {
- /**
- * 退款审核
- * @var string
- */
- public string $queue = "audit-order";
- /**
- * 连接配置
- * @var string
- */
- public string $connection = "default";
- public function consume($data): bool
- {
- try {
- echo getDateFull()."===执行推送\n";
- if(empty($data['order'])) return true;
- $order = (new SaasOrder)->where("order_sn",$data['order'])->findOrEmpty();
- if ($order->isEmpty()) return true;
- if (!in_array($order['status'],[1,6,4])) return true;
- $resp = (new OrderData)->config([
- "appid" => sConf("wechat.mini_appid"),
- "secret" => sConf("wechat.mini_secret"),
- ])->token()->auditOrder($order->toArray());
- echo getDateFull()."==={$data['order']}===退款审核推送\n";
- print_r($resp);
- return true;
- } catch (\Throwable $throwable) {
- echo getDateFull()."==推送退款审核报错===\n";
- echo $throwable->getFile()."\n";
- echo $throwable->getLine()."\n";
- echo $throwable->getMessage()."\n";
- }
- return true;
- }
- }
|