From 77bb52fe882df5aeb793462344a155d35d026da8 Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Tue, 14 May 2024 09:52:23 +0800 Subject: [PATCH] create_order --- app/mix/dao/mysql.go | 26 ++++++++++++++++++++++++++ app/mix/service/logic/vas.go | 16 ++++++++++++++++ 2 files changed, 42 insertions(+) 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