aa
This commit is contained in:
@@ -1326,3 +1326,20 @@ func GetStoreMapAudit(db *DaoDB, storeIDs, vendorIDs, auditStatuss []int, fromTi
|
||||
}
|
||||
return page, err
|
||||
}
|
||||
|
||||
func GetBrandUser(db *DaoDB, brandID int, userID string) (brandUsers []*model.BrandUser, err error) {
|
||||
sql := `
|
||||
SELECT * FROM brand_user WHERE deleted_at = ?
|
||||
`
|
||||
sqlParams := []interface{}{utils.DefaultTimeValue}
|
||||
if brandID != 0 {
|
||||
sql += " AND brand_id = ?"
|
||||
sqlParams = append(sqlParams, brandID)
|
||||
}
|
||||
if userID != "" {
|
||||
sql += " AND user_id = ?"
|
||||
sqlParams = append(sqlParams, userID)
|
||||
}
|
||||
err = GetRows(db, &brandUsers, sql, sqlParams)
|
||||
return brandUsers, err
|
||||
}
|
||||
|
||||
@@ -812,12 +812,25 @@ type BrandBill struct {
|
||||
OrderID string `orm:"column(order_id)" json:"orderID"` //关联orderPay表的订单号
|
||||
}
|
||||
|
||||
func (*BrandBill) TableUnique() [][]string {
|
||||
func (*BrandBill) TableIndex() [][]string {
|
||||
return [][]string{
|
||||
[]string{"BrandID", "CreatedAt"},
|
||||
}
|
||||
}
|
||||
|
||||
type BrandUser struct {
|
||||
ModelIDCULD
|
||||
|
||||
BrandID int `orm:"column(brand_id)" json:"brandID"` //品牌ID
|
||||
UserID string `orm:"column(user_id) json:"userID"`
|
||||
}
|
||||
|
||||
func (*BrandUser) TableIndex() [][]string {
|
||||
return [][]string{
|
||||
[]string{"BrandID", "UserID"},
|
||||
}
|
||||
}
|
||||
|
||||
type BrandStore struct {
|
||||
ModelIDCULD
|
||||
|
||||
|
||||
Reference in New Issue
Block a user