From 8dd3a52ce35cf81b068875d2b7b285a5f64bdfeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 11 Mar 2020 16:23:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E8=AE=A2=E5=8D=95=E4=B8=80?= =?UTF-8?q?=E5=91=A8=E5=86=85=E4=B8=8D=E8=83=BD=E9=87=8D=E5=A4=8D=E4=B8=8B?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/orderman_ext.go | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index 9b5023c1e..c830e25ea 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -1180,6 +1180,22 @@ func GetMatterStoreOrderCount(ctx *jxcontext.Context, storeID int) (result *Orde orderPay *model.OrderPay orderCount = &OrderCount{} ) + sql2 := ` + SELECT COUNT(*) count + FROM goods_order + WHERE IF(store_id = 0,jx_store_id,store_id) = ? + AND order_created_at <= NOW() AND order_created_at >= ? + AND status = ? + ` + sqlParams2 := []interface{}{ + storeID, + time.Now().AddDate(0, 0, -7), + model.OrderStatusFinished, + } + err = dao.GetRow(db, &orderCount, sql2, sqlParams2) + if err != nil { + return nil, err + } sql := ` SELECT b.* FROM goods_order a @@ -1201,21 +1217,5 @@ func GetMatterStoreOrderCount(ctx *jxcontext.Context, storeID int) (result *Orde } else { orderCount.Flag = true } - sql2 := ` - SELECT COUNT(*) count - FROM goods_order - WHERE IF(store_id = 0,jx_store_id,store_id) = ? - AND order_created_at <= NOW() AND order_created_at >= ? - AND status = ? - ` - sqlParams2 := []interface{}{ - storeID, - time.Now().AddDate(0, 0, -7), - model.OrderStatusFinished, - } - err = dao.GetRow(db, &orderCount, sql2, sqlParams2) - if err != nil { - return nil, err - } return orderCount, err }