huangjiajun преди 1 година
родител
ревизия
c20294d59e
променени са 3 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. +2
    -0
      db/db_day_luck_draw_settle_order.go
  2. +1
    -0
      db/model/day_luck_draw_settle_order.go
  3. +6
    -0
      svc/svc_day_luck_draw_settle_order.go

+ 2
- 0
db/db_day_luck_draw_settle_order.go Целия файл

@@ -29,6 +29,7 @@ func AddSettle(eg *xorm.Engine, req md.DayLuckDrawOrderJackpotReq) error {
Commission: req.Commission,
Uid: zhios_day_luck_draw_utils.StrToInt(req.Uid),
CreateTime: time.Now(),
Bili: req.Bili,
}
one, err := eg.InsertOne(data)
if one == 0 {
@@ -52,6 +53,7 @@ func AddSettleSess(sess *xorm.Session, req md.DayLuckDrawOrderJackpotReq) error
Commission: req.Commission,
Uid: zhios_day_luck_draw_utils.StrToInt(req.Uid),
CreateTime: time.Now(),
Bili: req.Bili,
}
one, err := sess.Insert(data)
if one == 0 {


+ 1
- 0
db/model/day_luck_draw_settle_order.go Целия файл

@@ -10,6 +10,7 @@ type DayLuckDrawSettleOrder struct {
Pvd string `json:"pvd" xorm:"unique(oid_pvd) index VARCHAR(255)"`
Amount string `json:"amount" xorm:"DECIMAL(11,6)"`
Commission string `json:"commission" xorm:"DECIMAL(11,6)"`
Bili string `json:"commission" xorm:"DECIMAL(11,6)"`
Uid int `json:"uid" xorm:"index INT(11)"`
CreateTime time.Time `json:"create_time" xorm:"DATETIME"`
IsSend int `json:"is_send" xorm:"default 0 INT(11)"`


+ 6
- 0
svc/svc_day_luck_draw_settle_order.go Целия файл

@@ -13,6 +13,9 @@ func AddSettleOrder(eg *xorm.Engine, req md.DayLuckDrawOrderJackpotReq) error {
return nil
}
drawSetting := db.GetDayLuckDrawSetting(eg)
if drawSetting.Source == "amount" {
return nil
}
req.Bili = drawSetting.CommissionBili
req.Commission = zhios_day_luck_draw_utils.Float64ToStrByPrec(zhios_day_luck_draw_utils.StrToFloat64(req.Commission)*(zhios_day_luck_draw_utils.StrToFloat64(req.Bili)/100), 7)
err := db.AddSettle(eg, req)
@@ -27,6 +30,9 @@ func AddSettleOrderSess(sess *xorm.Session, req md.DayLuckDrawOrderJackpotReq) e
return nil
}
drawSetting := db.GetDayLuckDrawSettingSess(sess)
if drawSetting.Source == "amount" {
return nil
}
req.Bili = drawSetting.CommissionBili
req.Commission = zhios_day_luck_draw_utils.Float64ToStrByPrec(zhios_day_luck_draw_utils.StrToFloat64(req.Commission)*(zhios_day_luck_draw_utils.StrToFloat64(req.Bili)/100), 7)
err := db.AddSettleSess(sess, req)


Зареждане…
Отказ
Запис