- basic cms structure.

This commit is contained in:
gazebo
2018-09-02 19:11:54 +08:00
parent d46bc8981a
commit 945431d566
19 changed files with 576 additions and 211 deletions

View File

@@ -0,0 +1,22 @@
package cms
import (
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/globals/gormdb"
)
func GetCities(parentCode int, vendorID int, includeDisabled bool) ([]*model.Place, error) {
db := gormdb.GetDB()
places := []*model.Place{}
sql := "enabled = 1 "
if includeDisabled {
sql = "1 = 1 "
}
if vendorID >= 0 {
if vendorID == model.VendorIDJD {
return places, db.Where(sql + "AND jd_code <> 0 AND level >= 2").Find(&places).Error
}
return nil, ErrHaveNotImplementedYet
}
return places, db.Where(sql+"AND parent_code = ?", parentCode).Find(&places).Error
}