fix(backend): 入库/出库列表 status 支持多状态 IN 查询 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package handler
|
||||
import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
@@ -33,7 +34,7 @@ func (h *StockOutHandler) List(c *gin.Context) {
|
||||
Where("shop_id = ? AND deleted_at IS NULL", shopID)
|
||||
|
||||
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 != "" {
|
||||
query = query.Where("order_date >= ?", startDate)
|
||||
|
||||
Reference in New Issue
Block a user