Browse Source

add reverse:for v4.0.6 积分释放规则

tags/v4.0.6
huangjiajun 2 years ago
parent
commit
749ec6a9e9
3 changed files with 12 additions and 4 deletions
  1. +7
    -4
      db/model/niu_bei_coin_basic.go
  2. +2
    -0
      md/commission_parameter.go
  3. +3
    -0
      rule/integral_release_settlement.go

+ 7
- 4
db/model/niu_bei_coin_basic.go View File

@@ -7,15 +7,18 @@ import (
type NiuBeiCoinBasic struct {
Id int `json:"id" xorm:"not null pk autoincr comment('主键id') INT(11)"`
IsUse int `json:"is_use" xorm:"not null default 0 comment('是否开启(否:0;是:1)') TINYINT(1)"`
Coin1 int `json:"coin_1" xorm:"not null default 0 comment('coinId_1(作用于消费积分)') INT(11)"`
Coin2 int `json:"coin_2" xorm:"not null default 0 comment('coinId_2(作用于牛贝积分)') INT(11)"`
Coin3 int `json:"coin_3" xorm:"not null default 0 comment('coinId_3(作用于抵扣劵)') INT(11)"`
Coin4 int `json:"coin_4" xorm:"not null default 0 comment('coinId_4(作用于期权激励)') INT(11)"`
Coin1 int `json:"coin_1" xorm:"coin_1 not null default 0 comment('coinId_1(作用于消费积分)') INT(11)"`
Coin2 int `json:"coin_2" xorm:"coin_2 not null default 0 comment('coinId_2(作用于牛贝积分)') INT(11)"`
Coin3 int `json:"coin_3" xorm:"coin_3 not null default 0 comment('coinId_3(作用于抵扣劵)') INT(11)"`
Coin4 int `json:"coin_4" xorm:"coin_4 not null default 0 comment('coinId_4(作用于期权激励)') INT(11)"`
TotalCoinReleaseRatio string `json:"total_coin_release_ratio" xorm:"not null default 0.0000 comment('总积分释放比例') DECIMAL(10,4)"`
DailyConsumeCoinReleaseRatio string `json:"daily_consume_coin_release_ratio" xorm:"not null default 0.0000 comment('每日消费积分释放比例') DECIMAL(10,4)"`
DailyNiubeiCoinReleaseRatio string `json:"daily_niubei_coin_release_ratio" xorm:"not null default 0.0000 comment('每日牛贝积分释放比例') DECIMAL(10,4)"`
DailyCouponCoinReleaseRatio string `json:"daily_coupon_coin_release_ratio" xorm:"not null default 0.0000 comment('每日抵扣劵释放比例') DECIMAL(10,4)"`
CouponConsumeDeductionRatio string `json:"coupon_consume_deduction_ratio" xorm:"not null default 0.0000 comment('抵扣劵消费抵扣比例') DECIMAL(10,4)"`
SupplyRatio string `json:"supply_ratio" xorm:"not null default 0.0000 comment('供应链获得积分比例') DECIMAL(10,4)"`
MallRatio string `json:"mall_ratio" xorm:"not null default 0.0000 comment('自营商品获得积分比例') DECIMAL(10,4)"`
O2oRatio string `json:"o2o_ratio" xorm:"not null default '' comment('o2o获得积分比例 json ') VARCHAR(255)"`
ReleaseDate string `json:"release_date" xorm:"not null default '0000-00-00' comment('释放日期') VARCHAR(50)"`
Ext string `json:"ext" xorm:"TEXT"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') TIMESTAMP"`


+ 2
- 0
md/commission_parameter.go View File

@@ -16,6 +16,8 @@ type CommissionParam struct {
IsGoods string `json:"is_goods"`
ShowLevel string `json:"show_level"`
IsShowExtend string `json:"is_show_extend"`
GoodsCommission string `json:"goods_commission"`
GoodsType string `json:"goods_type"`
}
type CommissionFirstParam struct {
CommissionParam CommissionParam `json:"commission_param"`


+ 3
- 0
rule/integral_release_settlement.go View File

@@ -84,6 +84,9 @@ func DailySettlementIntegralRelease(engine *xorm.Engine, mid string, isTask bool
"value": 1,
})
for _, ord := range *integralReleaseUserWithOrds {
if zhios_order_relate_utils.StrToFloat64(ord.OrdDiscountRatio) == 0 {
continue
}
//计算释放系数
err, releaseSpeed := CalcReleaseRate(integralRelease, zhios_order_relate_utils.StrToFloat64(ord.OrdDiscountRatio))
if err != nil {


Loading…
Cancel
Save