diff --git a/app/common/dao/store/order/StoreOrderDao.php b/app/common/dao/store/order/StoreOrderDao.php index f9ae2f65..35daec06 100644 --- a/app/common/dao/store/order/StoreOrderDao.php +++ b/app/common/dao/store/order/StoreOrderDao.php @@ -513,7 +513,7 @@ class StoreOrderDao extends BaseDao { return StoreOrderStatus::getDB()->alias('A')->leftJoin('StoreOrder B', 'A.order_id = B.order_id') ->where('A.change_type', 'take') - ->where('A.change_time', '<', $end)->where('B.paid', 1)->where('B.status', 2)->where('B.pay_type', '!=', StoreGroupOrder::PAY_TYPE_CREDIT_BUY) + ->where('A.change_time', '<', $end)->where('B.paid', 1)->where('B.status', 2)->where('B.pay_type', '<>', StoreGroupOrder::PAY_TYPE_CREDIT_BUY) ->column('A.order_id'); } diff --git a/crmeb/listens/AutoCheckCreditBuyListen.php b/crmeb/listens/AutoCheckCreditBuyListen.php index 82556438..52c9d58f 100644 --- a/crmeb/listens/AutoCheckCreditBuyListen.php +++ b/crmeb/listens/AutoCheckCreditBuyListen.php @@ -13,14 +13,15 @@ class AutoCheckCreditBuyListen extends TimerService implements ListenerInterface { public function handle($event): void { - Log::info(__FUNCTION__ . '监听到信用购订单自动结算'); - $tomorrow = strtotime('tomorrow 14:30:00'); + Log::info('credit buy listen start'); + $tomorrow = strtotime('tomorrow 15:00:00'); $time = ($tomorrow - time()) * 1000; $this->tick($time, function () { request()->clearCache(); $time = strtotime('+3 days'); $unSettle = StoreOrderInterest::whereBetweenTime('start_time', time(), $time)->where('status', 0)->group('mer_id')->column('order_id,mer_id'); foreach ($unSettle as $item) { + Log::info('credit buy listen push job'); Queue::push(SendSmsJob::class, ['tempId' => 'MERCHANT_CREDIT_BUY_NOTICE', 'id' => $item['mer_id'], 'orderId' => $item['order_id']]); } });