|
1234567891011121314151617181920212223242526 |
- 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"
- "code.fnuoos.com/go_rely_warehouse/zyos_go_coupon.git/utils/logx"
- "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)
- if err != nil {
- return 0, err
- }
- return total, err
- }
-
- //查询记录
- func CommCouponBaseList(Db *xorm.Engine) (*model.CommCoupon, error) {
- var CommCouponBaseList model.CommCoupon
- if has, err := Db.Get(&CommCouponBaseList); err != nil || !has {
- return nil, logx.Error(err)
- }
- return &CommCouponBaseList, nil
- }
|