活动删除直降

This commit is contained in:
苏尹岚
2020-09-08 15:24:23 +08:00
parent 6bda593cb4
commit d40a281b2e
3 changed files with 181 additions and 3 deletions

View File

@@ -1317,15 +1317,15 @@ func setJdsOrderSeq(order *model.GoodsOrder) (err error) {
type tCount struct {
Count int `json:"count"`
}
var count = &tCount{}
var counts []*tCount
sql := `
SELECT count(*) count FROM goods_order WHERE store_id = ? AND order_create_at >= ? AND order_create_at <= ? AND vendor_id = ?
`
sqlParams := []interface{}{
order.StoreID, utils.Time2Date(time.Now()), utils.Time2Date(time.Now().AddDate(0, 0, 1)), order.VendorID,
}
err = dao.GetRow(dao.GetDB(), &count, sql, sqlParams)
order.OrderSeq = count.Count + 1
err = dao.GetRows(dao.GetDB(), &counts, sql, sqlParams)
order.OrderSeq = counts[0].Count + 1
return err
}