feat(order): 订单列表支持创建时间筛选
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user