|
|
@@ -359,7 +359,9 @@ func DealUserConsumeIntegral(session *xorm.Session, subsidyWithUser *model.Subsi |
|
|
|
} |
|
|
|
balanceAmount := subsidyWithUser.LeaveDay |
|
|
|
afterAmount := balanceAmount - 1 |
|
|
|
isEnd := 0 |
|
|
|
if afterAmount <= 0 { |
|
|
|
isEnd = 1 |
|
|
|
afterAmount = 0 |
|
|
|
subsidyWithUser.State = 3 //补贴完 |
|
|
|
} |
|
|
@@ -371,11 +373,14 @@ func DealUserConsumeIntegral(session *xorm.Session, subsidyWithUser *model.Subsi |
|
|
|
if updateAffected <= 0 { |
|
|
|
return errors.New("修改 subsidy_with_user 记录失败") |
|
|
|
} |
|
|
|
|
|
|
|
if isEnd == 1 { |
|
|
|
return nil |
|
|
|
} |
|
|
|
//2、新增 subsidy_with_user_flow 记录 |
|
|
|
var subsidyWitUserFlow = &model.SubsidyWithUserFlow{ |
|
|
|
RecordsId: subsidyWithUser.Id, |
|
|
|
Day: 1, |
|
|
|
Amount: zhios_order_relate_utils.Float64ToStr(consumeIntegralValue), |
|
|
|
LeaveDay: afterAmount, |
|
|
|
CreateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
UpdateAt: now.Format("2006-01-02 15:04:05"), |
|
|
@@ -431,7 +436,9 @@ func DealUserExperienceIntegral(session *xorm.Session, subsidyWithUser *model.Su |
|
|
|
} |
|
|
|
balanceAmount := subsidyWithUser.LeaveDay |
|
|
|
afterAmount := balanceAmount - 1 |
|
|
|
isEnd := 0 |
|
|
|
if afterAmount <= 0 { |
|
|
|
isEnd = 1 |
|
|
|
afterAmount = 0 |
|
|
|
subsidyWithUser.State = 3 //补贴完 |
|
|
|
} |
|
|
@@ -443,12 +450,15 @@ func DealUserExperienceIntegral(session *xorm.Session, subsidyWithUser *model.Su |
|
|
|
if updateAffected <= 0 { |
|
|
|
return errors.New("修改 subsidy_with_user 记录失败") |
|
|
|
} |
|
|
|
|
|
|
|
if isEnd == 1 { |
|
|
|
return nil |
|
|
|
} |
|
|
|
//2、新增 subsidy_with_user_flow 记录 |
|
|
|
var subsidyWitUserFlow = &model.SubsidyWithUserFlow{ |
|
|
|
RecordsId: subsidyWithUser.Id, |
|
|
|
Uid: subsidyWithUser.Uid, |
|
|
|
Kind: subsidyWithUser.Kind, |
|
|
|
Amount: zhios_order_relate_utils.Float64ToStr(experienceIntegralValue), |
|
|
|
Day: 1, |
|
|
|
LeaveDay: afterAmount, |
|
|
|
CreateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|