From b6061ca1c775d764f4d96b69381bbe39d205ea6d Mon Sep 17 00:00:00 2001 From: howell <2827207845@qq.com> Date: Tue, 4 Jan 2022 10:40:11 +0800 Subject: [PATCH] fix: brand --- internal/api/mobile/users/register.go | 2 +- internal/v2/logic/app/user/income.go | 9 +++++---- internal/v2/logic/supplier/brand/brand.go | 12 ++++++------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/internal/api/mobile/users/register.go b/internal/api/mobile/users/register.go index a9cb0ff..7380995 100755 --- a/internal/api/mobile/users/register.go +++ b/internal/api/mobile/users/register.go @@ -266,7 +266,7 @@ func MobileRegister(c *gin.Context) { } // 从手机注册时用户邀请码默认为id时6的用户,邀请码为NXR0L3 - p.InvitationNo = "NXR0L3" + // p.InvitationNo = "NXR0L3" // 根据 不同的码 去调用不同的 下级规则 // 获取用户角色等级 diff --git a/internal/v2/logic/app/user/income.go b/internal/v2/logic/app/user/income.go index 39fce47..b19962c 100644 --- a/internal/v2/logic/app/user/income.go +++ b/internal/v2/logic/app/user/income.go @@ -1,10 +1,11 @@ package user import ( - "git.oa00.com/go/mysql" - "github.com/shopspring/decimal" "recook/internal/model/order" "recook/internal/v2/model/recook/user" + + "git.oa00.com/go/mysql" + "github.com/shopspring/decimal" ) var IncomeLogic = &incomeLogic{} @@ -67,7 +68,7 @@ func (i *incomeLogic) Profit(userID uint) (res Profit) { res.ECount4 += 1 res.EAmount4 = res.EAmount4.Add(v.Income) } - res.Total = res.Total.Add(v.Income) + res.ETotal = res.ETotal.Add(v.Income) case 2: switch v.Type { case 1: @@ -83,7 +84,7 @@ func (i *incomeLogic) Profit(userID uint) (res Profit) { res.Count4 += 1 res.Amount4 = res.EAmount4.Add(v.Income) } - res.ETotal = res.ETotal.Add(v.Income) + res.Total = res.ETotal.Add(v.Income) } } return diff --git a/internal/v2/logic/supplier/brand/brand.go b/internal/v2/logic/supplier/brand/brand.go index 3178cf3..1073db2 100644 --- a/internal/v2/logic/supplier/brand/brand.go +++ b/internal/v2/logic/supplier/brand/brand.go @@ -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 {