|
|
@@ -8,6 +8,7 @@ import (
|
|
|
"mtp2_if/global/e"
|
|
|
"mtp2_if/logger"
|
|
|
"net/http"
|
|
|
+ "strings"
|
|
|
"time"
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
@@ -324,9 +325,10 @@ func QueryPositionCancel(c *gin.Context) {
|
|
|
|
|
|
// QueryPresaleGoodsExReq 查询产能预售商品扩展请求参数
|
|
|
type QueryPresaleGoodsExReq struct {
|
|
|
- GoodsID int `form:"goodsid"`
|
|
|
- MarketID int `form:"marketid"`
|
|
|
- PresaleMode int `form:"presalemode"`
|
|
|
+ GoodsID int `form:"goodsid"`
|
|
|
+ MarketID int `form:"marketid"`
|
|
|
+ PresaleMode int `form:"presalemode"`
|
|
|
+ GoodsIDs string `form:"goodsids"`
|
|
|
}
|
|
|
|
|
|
// Cptradepresalegoodsex 产能预售商品扩展表
|
|
|
@@ -362,6 +364,7 @@ func (Cptradepresalegoodsex) TableName() string {
|
|
|
// @Param goodsid query int false "预售商品ID"
|
|
|
// @Param marketid query int false "预售市场ID"
|
|
|
// @Param presalemode query int false "预售模式 - 1:一口价 2:大宗式竞拍"
|
|
|
+// @Param goodsids query string false "预售商品ID列表 - 格式:1,2,3"
|
|
|
// @Success 200 {object} Cptradepresalegoodsex
|
|
|
// @Failure 500 {object} app.Response
|
|
|
// @Router /CPTrade/QueryPresaleGoodsEx [get]
|
|
|
@@ -369,6 +372,7 @@ func (Cptradepresalegoodsex) TableName() string {
|
|
|
func QueryPresaleGoodsEx(c *gin.Context) {
|
|
|
appG := app.Gin{C: c}
|
|
|
|
|
|
+ // FIXME: 由于数据中包括[]int类型,会造成校验报错,故暂时不使用
|
|
|
// 获取请求参数
|
|
|
var req QueryPresaleGoodsExReq
|
|
|
if err := appG.C.ShouldBindQuery(&req); err != nil {
|
|
|
@@ -390,6 +394,10 @@ func QueryPresaleGoodsEx(c *gin.Context) {
|
|
|
if req.PresaleMode > 0 {
|
|
|
s = s.And("PresaleMode=?", req.PresaleMode)
|
|
|
}
|
|
|
+ if len(req.GoodsIDs) > 0 {
|
|
|
+ // s = s.And("GoodsID in (?)", req.GoodsIDs)
|
|
|
+ s = s.In("GOODSID", strings.Split(req.GoodsIDs, ","))
|
|
|
+ }
|
|
|
if err := s.Find(&datas); err != nil {
|
|
|
// 查询失败
|
|
|
logger.GetLogger().Errorf("QueryPresaleGoodsEx failed: %s", err.Error())
|