This commit is contained in:
suyl
2021-09-10 09:11:23 +08:00
parent 4ae75be0d6
commit 92fd4c8107
5 changed files with 24 additions and 18 deletions

View File

@@ -4062,8 +4062,8 @@ type GetBrandsResult struct {
Balance int `json:"balance"`
}
func GetBrands(ctx *jxcontext.Context, name string, brandID int) (getBrandsResult []*GetBrandsResult, err error) {
brands, _ := dao.GetBrands(dao.GetDB(), name, brandID, "")
func GetBrands(ctx *jxcontext.Context, name string, brandID int, isManage bool) (getBrandsResult []*GetBrandsResult, err error) {
brands, _ := dao.GetBrands(dao.GetDB(), name, brandID, "", isManage, ctx.GetUserID())
for _, v := range brands {
balance, _ := partner.CurStoreAcctManager.GetBrandBalance(v.ID)
result := &GetBrandsResult{
@@ -4138,7 +4138,7 @@ func CreateVendorStore(ctx *jxcontext.Context, storeID, vendorID int, payload ma
return fmt.Errorf("请选择平台账号!")
}
if vendorID == model.VendorIDMTWM {
if brands, err := dao.GetBrands(db, "", storeDetail.BrandID, ""); err == nil {
if brands, err := dao.GetBrands(db, "", storeDetail.BrandID, "", false, ""); err == nil {
if len(brands) > 0 {
if strings.Contains(brands[0].Name, "无品牌") {
return fmt.Errorf("无品牌店铺不允许创建美团门店!")