- dao.FormalizeStoreStatus
This commit is contained in:
@@ -56,12 +56,12 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int,
|
||||
if storeKV != nil {
|
||||
store := &model.Store{}
|
||||
store.ID = storeDetail.Store.ID
|
||||
if _, err = dao.UpdateEntityLogically(db, store, storeKV, "admin", nil); err != nil {
|
||||
if _, err = dao.UpdateEntityLogically(db, store, storeKV, model.AdminName, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if storeMapKV != nil {
|
||||
if _, err = dao.UpdateEntityLogically(db, &model.StoreMap{}, storeMapKV, "admin", map[string]interface{}{
|
||||
if _, err = dao.UpdateEntityLogically(db, &model.StoreMap{}, storeMapKV, model.AdminName, map[string]interface{}{
|
||||
model.FieldStoreID: storeDetail.Store.ID,
|
||||
model.FieldVendorID: vendorID,
|
||||
model.FieldDeletedAt: utils.DefaultTimeValue,
|
||||
@@ -69,6 +69,12 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int,
|
||||
return err
|
||||
}
|
||||
}
|
||||
if storeStatus != model.StoreStatusOpened {
|
||||
// 因为storeStatus != model.StoreStatusOpened不会修改京西门店的状态,所以直接用storeDetail.Status是合适的
|
||||
if err = dao.FormalizeStoreStatus(db, storeDetail.Store.ID, storeDetail.Status); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
dao.Commit(db)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user