|
|
@ -49,15 +49,10 @@ type GetCouponReq struct { |
|
|
|
UserId string |
|
|
|
CouponId string |
|
|
|
ExpireTime string |
|
|
|
} |
|
|
|
|
|
|
|
type GetUpdateCouponReq struct { |
|
|
|
Req |
|
|
|
UserId string |
|
|
|
CouponId string |
|
|
|
OrderSn string |
|
|
|
Remark string |
|
|
|
IsUse string |
|
|
|
OrderSn string |
|
|
|
Remark string |
|
|
|
IsUse string |
|
|
|
Usertime string |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -223,7 +218,7 @@ func AddUserScore(dbname, userId, score string, url ...string) (int64, error) { |
|
|
|
* @bin |
|
|
|
*/ |
|
|
|
func UpdateUserScore(dbname, userId, score, used_score string, url ...string) (bool, error) { |
|
|
|
if dbname == "" || userId == "" || score == "" || used_score == "" { |
|
|
|
if dbname == "" || userId == "" || score == "" { |
|
|
|
return false, errors.New("参数错误") |
|
|
|
} |
|
|
|
|
|
|
@ -578,7 +573,7 @@ func AddUserRedEnvelope(dbname, userId, money string, url ...string) (int64, err |
|
|
|
* @2021/09/30 |
|
|
|
* @bin |
|
|
|
*/ |
|
|
|
func UpdateUserRedEnvelope(dbname, userId, money string, url ...string) (bool, error) { |
|
|
|
func UpdateUserRedEnvelope(dbname, userId, money, used_money string, url ...string) (bool, error) { |
|
|
|
if dbname == "" || userId == "" || money == "" { |
|
|
|
return false, errors.New("参数错误") |
|
|
|
} |
|
|
@ -589,10 +584,11 @@ func UpdateUserRedEnvelope(dbname, userId, money string, url ...string) (bool, e |
|
|
|
} |
|
|
|
defer conn.Close() |
|
|
|
|
|
|
|
data := GetAddReq{} |
|
|
|
data := GetUpdateReq{} |
|
|
|
data.Dbname = dbname |
|
|
|
data.UserId = userId |
|
|
|
data.Value = money |
|
|
|
data.UsedValue = used_money |
|
|
|
|
|
|
|
req, err := SetReqData(data) |
|
|
|
if err != nil { |
|
|
@ -602,7 +598,7 @@ func UpdateUserRedEnvelope(dbname, userId, money string, url ...string) (bool, e |
|
|
|
|
|
|
|
res := &Response{} |
|
|
|
|
|
|
|
err = conn.UpdateUserUpgrade(req, res) |
|
|
|
err = conn.UpdateUserRedEnvelope(req, res) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
log.Println("userrpc UpdateUserRedEnvelope error:", err) |
|
|
@ -635,7 +631,7 @@ func UpdateUserRedEnvelope(dbname, userId, money string, url ...string) (bool, e |
|
|
|
* @2021/09/30 |
|
|
|
* @bin |
|
|
|
*/ |
|
|
|
func AddUserRedEnvelopeLog(dbname, UserId, Money, Before, After, Source, SourceId, OrderSn, Target, TargetId, ProductThumb, Memo string, url ...string) (int64, error) { |
|
|
|
func AddUserRedEnvelopeLog(dbname, UserId, Money, Before, After, Source, SourceId, OrderSn, Target, TargetId, Memo string, url ...string) (int64, error) { |
|
|
|
if dbname == "" || UserId == "" || Money == "" || After == "" { |
|
|
|
return 0, errors.New("参数错误") |
|
|
|
} |
|
|
@ -657,7 +653,6 @@ func AddUserRedEnvelopeLog(dbname, UserId, Money, Before, After, Source, SourceI |
|
|
|
data.OrderSn = OrderSn |
|
|
|
data.Target = Target |
|
|
|
data.TargetId = TargetId |
|
|
|
data.ProductThumb = ProductThumb |
|
|
|
data.Memo = Memo |
|
|
|
|
|
|
|
req, err := SetReqData(data) |
|
|
@ -701,7 +696,7 @@ func AddUserRedEnvelopeLog(dbname, UserId, Money, Before, After, Source, SourceI |
|
|
|
* @2021/09/30 |
|
|
|
* @bin |
|
|
|
*/ |
|
|
|
func AddUserCoupon(dbname, userId, couponId, expireTime string, url ...string) (int64, error) { |
|
|
|
func AddUserCoupon(dbname, userId, couponId, expireTime, orderSn, remark string, url ...string) (int64, error) { |
|
|
|
if dbname == "" || userId == "" || couponId == "" { |
|
|
|
return 0, errors.New("参数错误") |
|
|
|
} |
|
|
@ -717,6 +712,8 @@ func AddUserCoupon(dbname, userId, couponId, expireTime string, url ...string) ( |
|
|
|
data.UserId = userId |
|
|
|
data.CouponId = couponId |
|
|
|
data.ExpireTime = expireTime |
|
|
|
data.OrderSn = orderSn |
|
|
|
data.Remark = remark |
|
|
|
|
|
|
|
req, err := SetReqData(data) |
|
|
|
if err != nil { |
|
|
@ -759,7 +756,7 @@ func AddUserCoupon(dbname, userId, couponId, expireTime string, url ...string) ( |
|
|
|
* @2021/09/30 |
|
|
|
* @bin |
|
|
|
*/ |
|
|
|
func UpdateUserCoupon(dbname, userId, couponId, remark, orderSn, isUse string, url ...string) (bool, error) { |
|
|
|
func UpdateUserCoupon(dbname, userId, couponId, remark, orderSn, isUse, usetime string, url ...string) (bool, error) { |
|
|
|
if dbname == "" || userId == "" || couponId == "" { |
|
|
|
return false, errors.New("参数错误") |
|
|
|
} |
|
|
@ -770,13 +767,14 @@ func UpdateUserCoupon(dbname, userId, couponId, remark, orderSn, isUse string, u |
|
|
|
} |
|
|
|
defer conn.Close() |
|
|
|
|
|
|
|
data := GetUpdateCouponReq{} |
|
|
|
data := GetCouponReq{} |
|
|
|
data.Dbname = dbname |
|
|
|
data.UserId = userId |
|
|
|
data.CouponId = couponId |
|
|
|
data.Remark = remark |
|
|
|
data.OrderSn = orderSn |
|
|
|
data.IsUse = isUse |
|
|
|
data.Usertime = usetime |
|
|
|
|
|
|
|
req, err := SetReqData(data) |
|
|
|
if err != nil { |
|
|
|