This commit is contained in:
苏尹岚
2021-01-06 09:46:54 +08:00
parent 756b39711d
commit 5753470c8b
4 changed files with 10 additions and 4 deletions

View File

@@ -926,7 +926,7 @@ func GetStoreAuditPage(db *DaoDB, statuss []int, keyword string, applyTimeStart,
return pagedInfo, err
}
func GetBrands(db *DaoDB, name string) (brands []*model.Brand, err error) {
func GetBrands(db *DaoDB, name string, brandID int) (brands []*model.Brand, err error) {
sql := `
SELECT *
FROM brand
@@ -939,6 +939,10 @@ func GetBrands(db *DaoDB, name string) (brands []*model.Brand, err error) {
sql += " AND name LIKE ?"
sqlParams = append(sqlParams, "%"+name+"%")
}
if brandID != 0 {
sql += " AND id = ?"
sqlParams = append(sqlParams, brandID)
}
err = GetRows(db, &brands, sql, sqlParams)
return brands, err
}

View File

@@ -57,6 +57,7 @@ type User struct {
LastLoginAt *time.Time `orm:"null" json:"lastLoginAt"`
LastLoginIP string `orm:"size(64);column(last_login_ip)" json:"lastLoginIP"`
LastLoginType string `orm:"size(16)" json:"lastLoginType"`
LastBrandID int `orm:"column(last_brand_id)" json:"lastBrandID"`
ParentMobile string `orm:"size(32)" json:"parentMobile"`
DividePercentage int `json:"dividePercentage"`