feat(order): 订单列表支持创建时间筛选

This commit is contained in:
yml
2026-11-22 15:53:23 +08:00
parent 952ec71219
commit 6fcd5bac9c
9 changed files with 235 additions and 2 deletions
@@ -504,6 +504,8 @@ func TestNewOrderNoUsesShanghaiTimeWhenLocalIsUTC(t *testing.T) {
func TestApplyAdminOrderFiltersSmartRouting(t *testing.T) {
db := database.NewDryRunDB()
start := time.Date(2026, 11, 1, 0, 0, 0, 0, timeutil.ShanghaiLocation())
end := time.Date(2026, 11, 2, 23, 59, 59, int(time.Second-time.Nanosecond), timeutil.ShanghaiLocation())
tests := []struct {
name string
@@ -540,6 +542,11 @@ func TestApplyAdminOrderFiltersSmartRouting(t *testing.T) {
query: AdminOrderQuery{Keyword: "测试账号"},
wantSQLFrag: "o.order_no LIKE ? OR l.listing_no LIKE ? OR a.title LIKE ? OR owner.phone LIKE ? OR renter.phone LIKE ?",
},
{
name: "创建时间范围同时限制起止时间",
query: AdminOrderQuery{StartTime: &start, EndTime: &end},
wantSQLFrag: "o.created_at >= ? AND o.created_at <= ?",
},
}
for _, tt := range tests {