缓存订单同步

This commit is contained in:
jianghanbo 2024-12-20 16:43:01 +08:00
parent c2384f1836
commit 414d30311c
1 changed files with 5 additions and 0 deletions

View File

@ -94,6 +94,10 @@ class Orders {
public static function syncFromThird(OrdersModel $order) public static function syncFromThird(OrdersModel $order)
{ {
$redisKey = 'sync_order:' . $order->sn;
if (Redis::exists($redisKey)) {
return 1;
}
$got = null; $got = null;
switch ($order->os) { switch ($order->os) {
@ -144,6 +148,7 @@ class Orders {
if ($back) { if ($back) {
self::finance(0, $order->id, $order->asset_price); self::finance(0, $order->id, $order->asset_price);
} }
Redis::setEx($redisKey, 600, 1);
return 0; return 0;
} }