huangjiajun hace 11 meses
padre
commit
3a3e2891ca
Se han modificado 3 ficheros con 10 adiciones y 2 borrados
  1. +7
    -0
      app/db/db_order.go
  2. +1
    -0
      app/db/model/ord_list.go
  3. +2
    -2
      consume/zhios_order_hjy.go

+ 7
- 0
app/db/db_order.go Ver fichero

@@ -177,6 +177,13 @@ func OrderListByPvdOid(sess *xorm.Session, oid string) (*model.OrdList, error) {
}
return &o, nil
}
func OrderListByhjyOid(sess *xorm.Session, oid string) (*model.OrdList, error) {
var o model.OrdList
if has, err := sess.Where("hjy_oid=?", oid).Get(&o); err != nil || !has {
return nil, logx.Error(err)
}
return &o, nil
}
func OrderListByUpdateOrd(sess *xorm.Session, ord *model.OrdList) (bool, error) {
if row, err := sess.Where("pvd_oid = ? ", ord.PvdOid).AllCols().Update(ord); row == 0 || err != nil {
return false, logx.Warn(err)


+ 1
- 0
app/db/model/ord_list.go Ver fichero

@@ -56,5 +56,6 @@ type OrdList struct {
FastSuccess int `xorm:"not null default 0 INT(1)" json:"fast_success"`
BuckleCommission string `json:"buckle_commission" xorm:"DECIMAL(20,2)"`
OrderFormType int `xorm:"not null default 0 INT(1)" json:"order_form_type"`
HjyOid int `xorm:"not null default 0 INT(11)" json:"hjy_oid"`
TikTokTeamRealCommission string `json:"tik_tok_team_real_commission" xorm:"not null default 0.00 comment('') DECIMAL(20,8)"`
}

+ 2
- 2
consume/zhios_order_hjy.go Ver fichero

@@ -140,7 +140,7 @@ func handleZhiosOrderHjy(msg []byte) error {
defer sess.Close()
sess.Begin()

ordData, err := db.OrderListByPvdOid(sess, canalMsg.Oid)
ordData, err := db.OrderListByhjyOid(sess, canalMsg.Oid)
if err != nil || ordData == nil {
return nil
}
@@ -163,7 +163,7 @@ func handleZhiosOrderHjy(msg []byte) error {
sess.Commit()
return nil
}
isSettle, settleTime := GetHjyOrderCommission(eg, canalMsg.Mid, utils.Int64ToStr(ordData.OrdId))
isSettle, settleTime := GetHjyOrderCommission(eg, canalMsg.Mid, utils.IntToStr(ordData.HjyOid))
if isSettle == "1" {
ordData.State = 5
ordData.SettleAt = int(utils.TimeStdParseUnix(settleTime))


Cargando…
Cancelar
Guardar