Browse Source

add Reverse:for v1.1.0

tags/v1.1.0
huangjuajun 2 years ago
parent
commit
347304eb82
3 changed files with 7 additions and 7 deletions
  1. +2
    -2
      db/db_comm_coupon_user_ord.go
  2. +3
    -3
      db/db_comm_coupon_user_total.go
  3. +2
    -2
      db/db_coupon_comm_check.go

+ 2
- 2
db/db_comm_coupon_user_ord.go View File

@@ -2,7 +2,7 @@ package db

import (
"code.fnuoos.com/go_rely_warehouse/zyos_go_coupon.git/db/model"
"code.fnuoos.com/go_rely_warehouse/zyos_go_coupon.git/utils"
zhios_tool_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_tools.git/utils"
"fmt"
"xorm.io/xorm"
)
@@ -149,7 +149,7 @@ func commWhere(Db *xorm.Engine, uid int, types, pvdType, times string, ordType [
userOne, _ := UserFindByPhoneOrNickname(Db, keyword)
uids := "0"
if userOne != nil {
uids = utils.IntToStr(userOne.Uid)
uids = zhios_tool_utils.IntToStr(userOne.Uid)
}
dbWhere = dbWhere.And("to_uid = ? and to_uid>0", uids)
}


+ 3
- 3
db/db_comm_coupon_user_total.go View File

@@ -2,7 +2,7 @@ package db

import (
"code.fnuoos.com/go_rely_warehouse/zyos_go_coupon.git/db/model"
"code.fnuoos.com/go_rely_warehouse/zyos_go_coupon.git/utils"
zhios_tool_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_tools.git/utils"
"xorm.io/xorm"
)

@@ -24,14 +24,14 @@ func GetCouponUserByUid(Db *xorm.Engine, uid string) (*[]model.CommCouponUserTot

func GetCouponUserTotalByLeaveSumWithTypeSession(session *xorm.Session, uid int, pvdType string) (*[]model.CommCouponUserTotal, error) {
var m []model.CommCouponUserTotal
if err := session.Where("uid = " + utils.IntToStr(uid) + " and leave_coupon_amount_value>=0 and (pvd_type LIKE '%" + pvdType + "%' or pvd_type='ordinary' )").Asc("leave_coupon_amount_value").Find(&m); err != nil {
if err := session.Where("uid = " + zhios_tool_utils.IntToStr(uid) + " and leave_coupon_amount_value>=0 and (pvd_type LIKE '%" + pvdType + "%' or pvd_type='ordinary' )").Asc("leave_coupon_amount_value").Find(&m); err != nil {
return nil, err
}
return &m, nil
}
func GetCouponUserTotalByNegative(Db *xorm.Engine, uid int, pvdType, cols string) (float64, error) {
var m model.CommCouponUserTotal
total, err := Db.Where("uid = "+utils.IntToStr(uid)+" and leave_coupon_amount_value<0 and (pvd_type LIKE '%"+pvdType+"%' or pvd_type='ordinary' )").Sum(m, cols)
total, err := Db.Where("uid = "+zhios_tool_utils.IntToStr(uid)+" and leave_coupon_amount_value<0 and (pvd_type LIKE '%"+pvdType+"%' or pvd_type='ordinary' )").Sum(m, cols)
if err != nil {
return 0, err
}


+ 2
- 2
db/db_coupon_comm_check.go View File

@@ -2,14 +2,14 @@ package db

import (
"code.fnuoos.com/go_rely_warehouse/zyos_go_coupon.git/db/model"
"code.fnuoos.com/go_rely_warehouse/zyos_go_coupon.git/utils"
zhios_tool_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_tools.git/utils"
"fmt"
"xorm.io/xorm"
)

func GetCouponUserTotalByLeaveSumWithType(Db *xorm.Engine, uid int, pvdType, cols string) (float64, error) {
var m model.CommCouponUserTotal
total, err := Db.Where("uid = "+utils.IntToStr(uid)+" and (pvd_type LIKE '%"+pvdType+"%' or pvd_type='ordinary' )").Sum(m, cols)
total, err := Db.Where("uid = "+zhios_tool_utils.IntToStr(uid)+" and (pvd_type LIKE '%"+pvdType+"%' or pvd_type='ordinary' )").Sum(m, cols)
if err != nil {
fmt.Println(err)
return 0, err


Loading…
Cancel
Save