Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 50b5c9fccb |
@@ -5,6 +5,11 @@
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.0.65] - 2026-06-20
|
||||||
|
|
||||||
|
### 修复
|
||||||
|
- 单据列表状态筛选支持一次查询多种状态,配合客户端修复让「入库审核 / 出库审核」标签页完整列出全部待审核单据,不再因分页只显示部分
|
||||||
|
|
||||||
## [1.0.64] - 2026-06-20
|
## [1.0.64] - 2026-06-20
|
||||||
|
|
||||||
### 改进
|
### 改进
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@@ -40,7 +41,7 @@ func (h *StockInHandler) List(c *gin.Context) {
|
|||||||
Where("shop_id = ? AND deleted_at IS NULL", shopID)
|
Where("shop_id = ? AND deleted_at IS NULL", shopID)
|
||||||
|
|
||||||
if status := c.Query("status"); status != "" {
|
if status := c.Query("status"); status != "" {
|
||||||
query = query.Where("status = ?", status)
|
query = query.Where("status IN ?", strings.Split(status, ","))
|
||||||
}
|
}
|
||||||
if startDate := c.Query("start_date"); startDate != "" {
|
if startDate := c.Query("start_date"); startDate != "" {
|
||||||
query = query.Where("order_date >= ?", startDate)
|
query = query.Where("order_date >= ?", startDate)
|
||||||
|
|||||||
@@ -343,4 +343,9 @@ func TestStockInHandler_List_FilterByStatus(t *testing.T) {
|
|||||||
w = makeRequest(r, "GET", "/api/v1/stock-in/orders?status=draft", token, nil)
|
w = makeRequest(r, "GET", "/api/v1/stock-in/orders?status=draft", token, nil)
|
||||||
resp = parseResponse(w)
|
resp = parseResponse(w)
|
||||||
assert.Equal(t, float64(1), resp["total"].(float64))
|
assert.Equal(t, float64(1), resp["total"].(float64))
|
||||||
|
|
||||||
|
// 逗号分隔的多状态:pending + draft 应返回两条(审核标签页用法)
|
||||||
|
w = makeRequest(r, "GET", "/api/v1/stock-in/orders?status=pending,draft", token, nil)
|
||||||
|
resp = parseResponse(w)
|
||||||
|
assert.Equal(t, float64(2), resp["total"].(float64))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package handler
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
@@ -33,7 +34,7 @@ func (h *StockOutHandler) List(c *gin.Context) {
|
|||||||
Where("shop_id = ? AND deleted_at IS NULL", shopID)
|
Where("shop_id = ? AND deleted_at IS NULL", shopID)
|
||||||
|
|
||||||
if status := c.Query("status"); status != "" {
|
if status := c.Query("status"); status != "" {
|
||||||
query = query.Where("status = ?", status)
|
query = query.Where("status IN ?", strings.Split(status, ","))
|
||||||
}
|
}
|
||||||
if startDate := c.Query("start_date"); startDate != "" {
|
if startDate := c.Query("start_date"); startDate != "" {
|
||||||
query = query.Where("order_date >= ?", startDate)
|
query = query.Where("order_date >= ?", startDate)
|
||||||
|
|||||||
Reference in New Issue
Block a user