|
|
|
@ -69,7 +69,7 @@ func (b *brandLogic) Create(userId uint, brandType int, name string, logo string
|
|
|
|
|
|
|
|
|
|
enterpriseState := gysEnterpriseStateModel.FindByUserId(userId)
|
|
|
|
|
if enterpriseState.Id <= 0 {
|
|
|
|
|
return errors.New("网络异常")
|
|
|
|
|
return errors.New("网络异常1")
|
|
|
|
|
}
|
|
|
|
|
if enterpriseState.State != enterprise.GysEnterpriseStateSuc {
|
|
|
|
|
return errors.New("请先进行资料审核处理")
|
|
|
|
@ -98,7 +98,7 @@ func (b *brandLogic) Create(userId uint, brandType int, name string, logo string
|
|
|
|
|
gysEnterpriseBrandModel.SetDb(tx)
|
|
|
|
|
gysEnterpriseBrandModel.Create(&gysEnterpriseBrandModel)
|
|
|
|
|
if gysEnterpriseBrandModel.Id <= 0 {
|
|
|
|
|
return errors.New("网络异常")
|
|
|
|
|
return errors.New("网络异常2")
|
|
|
|
|
}
|
|
|
|
|
var images []enterprise.GysEnterpriseImgModel
|
|
|
|
|
imgType := enterprise.GysEnterpriseImgTypeReg
|
|
|
|
@ -111,7 +111,7 @@ func (b *brandLogic) Create(userId uint, brandType int, name string, logo string
|
|
|
|
|
BrandId: gysEnterpriseBrandModel.Id,
|
|
|
|
|
Type: imgType,
|
|
|
|
|
Url: url.Url,
|
|
|
|
|
Start: formatime.NewSecondFrom(time.Time(url.Start)),
|
|
|
|
|
Start: formatime.NewSecondNow(),
|
|
|
|
|
End: formatime.NewSecondFrom(time.Time(url.End)),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -120,7 +120,7 @@ func (b *brandLogic) Create(userId uint, brandType int, name string, logo string
|
|
|
|
|
BrandId: gysEnterpriseBrandModel.Id,
|
|
|
|
|
Type: enterprise.GysEnterpriseImgTypeRecook,
|
|
|
|
|
Url: url.Url,
|
|
|
|
|
Start: formatime.NewSecondFrom(time.Time(url.Start)),
|
|
|
|
|
Start: formatime.NewSecondNow(),
|
|
|
|
|
End: formatime.NewSecondFrom(time.Time(url.End)),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -129,7 +129,7 @@ func (b *brandLogic) Create(userId uint, brandType int, name string, logo string
|
|
|
|
|
BrandId: gysEnterpriseBrandModel.Id,
|
|
|
|
|
Type: enterprise.GysEnterpriseImgTypeOther,
|
|
|
|
|
Url: url.Url,
|
|
|
|
|
Start: formatime.NewSecondFrom(time.Time(url.Start)),
|
|
|
|
|
Start: formatime.NewSecondNow(),
|
|
|
|
|
End: formatime.NewSecondFrom(time.Time(url.End)),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -137,7 +137,7 @@ func (b *brandLogic) Create(userId uint, brandType int, name string, logo string
|
|
|
|
|
gysEnterpriseImgModel.SetDb(tx)
|
|
|
|
|
row := gysEnterpriseImgModel.CreateAll(&images)
|
|
|
|
|
if int(row) != len(images) {
|
|
|
|
|
return errors.New("网络异常")
|
|
|
|
|
return errors.New("网络异常3")
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}); err != nil {
|
|
|
|
|