diff --git a/application/cron/controller/PerformPerSecond.php b/application/cron/controller/PerformPerSecond.php index 465a02c..4a689f5 100644 --- a/application/cron/controller/PerformPerSecond.php +++ b/application/cron/controller/PerformPerSecond.php @@ -240,14 +240,9 @@ class PerformPerSecond */ public function processExpiredRedpackets() { - $now = time(); - $redpacketModel = new Redpacket(); - // 查找已结束但未退款的红包 $expiredRedpackets = Db::name('redpacket') -// ->where('status', Redpacket::STATUS_ACTIVE) - ->where('end_time', '<', $now) -// ->where('left_count', '>', 0) + ->where(['end_time' => ['<',time()]]) ->select(); foreach ($expiredRedpackets as $redpacket) { @@ -285,8 +280,8 @@ class PerformPerSecond Db::name('redpacket') ->where('id', $redpacket['id']) ->update([ - 'status' => Redpacket::STATUS_REFUNDED, - 'updatetime' => $now + 'status' => 3, + 'updatetime' => time() ]); // 清理Redis缓存