Browse Source

更新

three
huangjiajun 10 months ago
parent
commit
5995f6fbd1
1 changed files with 18 additions and 18 deletions
  1. +18
    -18
      consume/zhios_guide_store_order_success.go

+ 18
- 18
consume/zhios_guide_store_order_success.go View File

@@ -133,28 +133,28 @@ func fail(eg *xorm.Engine, canalMsg *md.ZhiosGuideStoreOrder) error {
sess := eg.NewSession()
defer sess.Close()
sess.Begin()
m, _ := db.FreeProductByID(eg, canalMsg.ItemId, canalMsg.Pvd)
//m, _ := db.FreeProductByID(eg, canalMsg.ItemId, canalMsg.Pvd)
//直接退回账号了 定制
storeOrder := db.GuideStoreOrderSess(sess, utils.StrToInt64(canalMsg.Oid))
if m != nil {
if storeOrder != nil && utils.StrToFloat64(storeOrder.DeductPrice) > 0 && storeOrder.DeductState == 1 {
coinId := db.SysCfgGetWithDb(eg, canalMsg.Mid, "guide_store_coin_id")
err := UpdateUserVirtualCoinFinValidAndInterFlow(sess,
utils.AnyToString(storeOrder.DeductPrice), "商品("+storeOrder.Gid+")退款退回", "0", 1, storeOrder.StoreId, utils.StrToInt(coinId), 114, utils.StrToInt64(canalMsg.Oid))
if err != nil {
sess.Rollback()
return err
}
storeOrder.DeductPrice = "0"
storeOrder.DeductState = 2
storeOrder.State = 4
_, err = sess.Where("id=?", storeOrder.Id).Update(storeOrder)
if err != nil {
sess.Rollback()
return err
}
//if m != nil {
if storeOrder != nil && utils.StrToFloat64(storeOrder.DeductPrice) > 0 && storeOrder.DeductState == 1 {
coinId := db.SysCfgGetWithDb(eg, canalMsg.Mid, "guide_store_coin_id")
err := UpdateUserVirtualCoinFinValidAndInterFlow(sess,
utils.AnyToString(storeOrder.DeductPrice), "商品("+storeOrder.Gid+")退款退回", "0", 1, storeOrder.StoreId, utils.StrToInt(coinId), 114, utils.StrToInt64(canalMsg.Oid))
if err != nil {
sess.Rollback()
return err
}
storeOrder.DeductPrice = "0"
storeOrder.DeductState = 2
storeOrder.State = 4
_, err = sess.Where("id=?", storeOrder.Id).Update(storeOrder)
if err != nil {
sess.Rollback()
return err
}
}
//}
sess.Commit()
return nil
}


Loading…
Cancel
Save