|
|
|
@ -23,6 +23,7 @@ import (
|
|
|
|
|
|
|
|
|
|
mysql2 "git.oa00.com/go/mysql"
|
|
|
|
|
"github.com/360EntSecGroup-Skylar/excelize/v2"
|
|
|
|
|
"gorm.io/gorm/clause"
|
|
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
"github.com/shopspring/decimal"
|
|
|
|
@ -858,10 +859,19 @@ func ExportPromotionDown(c *gin.Context) {
|
|
|
|
|
str = fmt.Sprintf("0%v:00", i)
|
|
|
|
|
}
|
|
|
|
|
if _, ok := gmp[str]; ok {
|
|
|
|
|
fmt.Println(str, gmp[str])
|
|
|
|
|
place := make([]string, 0)
|
|
|
|
|
ids := make([]interface{}, 0)
|
|
|
|
|
for _, v := range gmp[str] {
|
|
|
|
|
place = append(place, "?")
|
|
|
|
|
ids = append(ids, v)
|
|
|
|
|
}
|
|
|
|
|
field := fmt.Sprintf("FIELD(id, %s)", strings.Join(place, ","))
|
|
|
|
|
var goodsListS []goods3.RecookGoodsInfoModel
|
|
|
|
|
mysql2.Db.Table((&goods3.RecookGoodsInfoModel{}).TableName()).
|
|
|
|
|
Where("id in(?)", gmp[str]).
|
|
|
|
|
Clauses(clause.OrderBy{
|
|
|
|
|
Expression: clause.Expr{SQL: field, Vars: ids, WithoutParentheses: true},
|
|
|
|
|
}).
|
|
|
|
|
Preload("Brand").
|
|
|
|
|
Preload("FirstCategory").
|
|
|
|
|
Preload("SecondCategory").
|
|
|
|
|