From cc627da2a43c125ae6ee2f0ef490183a81815369 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 12 Apr 2019 17:26:28 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8DFormalizeStoreStatus?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=AD=BB=E9=94=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/model/dao/store.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/business/model/dao/store.go b/business/model/dao/store.go index d28e6c09e..97f10b1db 100644 --- a/business/model/dao/store.go +++ b/business/model/dao/store.go @@ -192,15 +192,15 @@ func FormalizeStoreStatus(db *DaoDB, storeID, storeStatus int) (err error) { storeID, } var statusList []int - Begin(db) - defer func() { - if err != nil { - Rollback(db) - } - }() if err = GetRows(db, &statusList, sql, sqlParams...); err == nil { if len(statusList) == 1 { if statusList[0] != model.StoreStatusOpened { + Begin(db) + defer func() { + if err != nil { + Rollback(db) + } + }() if storeStatus != statusList[0] { store := &model.Store{} store.ID = storeID