whereRawClauses[] = $sql; return $this; } }; YejiStatsLogic::applyPrescriptionOrderEffectiveAmountQuery($query, 'po'); if (count($query->whereRawClauses) !== 2) { throw new RuntimeException('有效金额过滤条件数量不正确'); } if (!str_contains($query->whereRawClauses[0], 'po.fulfillment_status NOT IN (4,9,10)')) { throw new RuntimeException('未排除已取消、拒收和全额退款状态'); } if (!str_contains($query->whereRawClauses[1], 'po.refund_amount <= 0')) { throw new RuntimeException('未排除已发生部分退款的订单'); } echo "FIRST_VISIT_EFFECTIVE_AMOUNT_FILTER_OK\n";