diff --git a/app/mix/dao/mysql.go b/app/mix/dao/mysql.go index a2497d7f..903df2f0 100644 --- a/app/mix/dao/mysql.go +++ b/app/mix/dao/mysql.go @@ -270,6 +270,32 @@ func (m *Mysql) GetOrders(ctx *gin.Context, tx *sqlx.Tx, mid, st, et int64, offs return } +// 获取订单数 +func (m *Mysql) GetOrderCnt(ctx *gin.Context, tx *sqlx.Tx, mid, st, et int64, orderStatus int32) (int, error) { + type S struct { + Cnt int `json:"cnt"` + } + var ( + err error + s = S{} + ) + sqlStr := fmt.Sprintf("select count(1) as cnt from %s where mid=? and order_status=? and ct>=? and ct= 8 { + err = fmt.Errorf("账号已受限,解限请联系客服") + return + } + var ( productId = req.ProductId order *dbstruct.Order