- InitPlace update enable

This commit is contained in:
gazebo
2018-12-04 22:48:04 +08:00
parent 3252665a59
commit 5510f9957f

View File

@@ -22,6 +22,7 @@ func insertPlace(ctx *jxcontext.Context, db *dao.DaoDB, parent *autonavi.Distric
Name: v.Name,
Level: int8(v.Level),
TelCode: v.Citycode,
Enabled: 1,
}
if parent != nil {
place.ParentCode = int(utils.Str2Int64(parent.Adcode))
@@ -94,6 +95,18 @@ func InitPlace(ctx *jxcontext.Context) (err error) {
SET t1.mtps_price = t2.price
WHERE t1.level = 2 AND t1.mtps_price = 0;
`,
`
UPDATE place t1
LEFT JOIN (
SELECT DISTINCT city_code
FROM store
UNION DISTINCT
SELECT DISTINCT place_code city_code
FROM sku_name_place_bind
) t2 ON t1.code = t2.city_code
SET t1.enabled = 0
WHERE t1.level = 2 AND t2.city_code IS NULL;
`,
}
for _, v := range updateSqls {
if _, err = dao.ExecuteSQL(db, v); err != nil {