瀏覽代碼

更新

three
huangjiajun 10 月之前
父節點
當前提交
5995f6fbd1
共有 1 個檔案被更改,包括 18 行新增18 行删除
  1. +18
    -18
      consume/zhios_guide_store_order_success.go

+ 18
- 18
consume/zhios_guide_store_order_success.go 查看文件

@@ -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…
取消
儲存