Merge branch 'jhc'
This commit is contained in:
commit
09b7bf516f
Binary file not shown.
@ -8,7 +8,14 @@ import (
|
|||||||
|
|
||||||
func QuerySaleAddress(in *artShow.SaleAddressReq) (out []*model.SaleAddress, err error) {
|
func QuerySaleAddress(in *artShow.SaleAddressReq) (out []*model.SaleAddress, err error) {
|
||||||
out = make([]*model.SaleAddress, 0)
|
out = make([]*model.SaleAddress, 0)
|
||||||
err = db.DbArtShow.Table("sale_address").Where("parent_name = ? ", in.ParentName).Find(&out).Error
|
queryDB := db.DbArtShow.Table("sale_address")
|
||||||
|
|
||||||
|
if in.ParentName == "-1" {
|
||||||
|
err = queryDB.Where("parent_name <> '0' ").Find(&out).Error
|
||||||
|
} else {
|
||||||
|
err = queryDB.Where("parent_name = ? ", in.ParentName).Find(&out).Error
|
||||||
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ func Init(confPath string) {
|
|||||||
LoadMysqlData(file)
|
LoadMysqlData(file)
|
||||||
|
|
||||||
//MySQL数据库
|
//MySQL数据库
|
||||||
path := strings.Join([]string{DbUser, ":", DbPassWord, "@tcp(", DbHost, ":", DbPort, ")/", DbName, "?charset=utf8&parseTime=true"}, "")
|
path := strings.Join([]string{DbUser, ":", DbPassWord, "@tcp(", DbHost, ":", DbPort, ")/", DbName, "?charset=utf8&parseTime=true&loc=Local"}, "")
|
||||||
//连接数据库
|
//连接数据库
|
||||||
Database(path)
|
Database(path)
|
||||||
//migration() //迁移表 按需打开
|
//migration() //迁移表 按需打开
|
||||||
|
Loading…
Reference in New Issue
Block a user