From a95322b6c5a15c5c43fa1145138cc62682a9a8c6 Mon Sep 17 00:00:00 2001 From: wood911010 Date: Tue, 24 Feb 2026 23:11:36 +0800 Subject: [PATCH] feat: Implement `CuOrderRepository` for managing customer orders, including CRUD, listing, and summary operations. --- backend/internal/repository/cu_order_repository.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/internal/repository/cu_order_repository.go b/backend/internal/repository/cu_order_repository.go index 5bcb745..9d6d428 100644 --- a/backend/internal/repository/cu_order_repository.go +++ b/backend/internal/repository/cu_order_repository.go @@ -143,7 +143,7 @@ func (r *cuOrderRepository) CheckTrialOrderExists(cuUserID string, currentMonth endOfMonth := currentMonth + "-31 23:59:59" err := r.db.Model(&models.CuOrder{}). - Where("cu_user_id = ? AND (status = 'paid' OR status = 'pending') AND created_at >= ? AND created_at <= ? AND deleted_at IS NULL", + Where("cu_orders.cu_user_id = ? AND (cu_orders.status = 'paid' OR cu_orders.status = 'pending') AND cu_orders.created_at >= ? AND cu_orders.created_at <= ? AND cu_orders.deleted_at IS NULL", cuUserID, startOfMonth, endOfMonth). // We need to join with package to check package type because package_id might be a UUID, not 'trial'. // But if the order already recorded the type somewhere or if we just assume 'trial' is the package ID?