- test for Change2JDSPU4Store

This commit is contained in:
gazebo
2019-01-05 15:17:19 +08:00
parent d0abc189be
commit 8d6d9a9787
2 changed files with 11 additions and 1 deletions

View File

@@ -319,6 +319,16 @@ func Convert2JDSPU(ctx *jxcontext.Context, count int, isAsync, isContinueWhenErr
func Change2JDSPU4Store(ctx *jxcontext.Context, storeIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
db := dao.GetDB()
if len(storeIDs) == 0 {
if err = dao.GetRows(db, &storeIDs, `
SELECT t1.id
FROM store t1
JOIN store_map t2 ON t2.store_id = t1.id AND t2.vendor_id = 0 AND t2.deleted_at = ? AND t2.status <> ?
WHERE t1.deleted_at = ? AND t1.status <> ? AND t1.city_code IN (110100, 120100, 440100, 440300, 510100)
`, utils.DefaultTimeValue, model.StoreStatusDisabled, utils.DefaultTimeValue, model.StoreStatusDisabled); err != nil {
return "", err
}
}
dao.Begin(db)
defer dao.Rollback(db)