old_order.go 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. package dao
  2. import (
  3. "context"
  4. "github.com/pkg/errors"
  5. "go-common/app/service/main/vip/model"
  6. )
  7. const (
  8. _insertOldPayOrder = "INSERT INTO vip_pay_order(order_no,app_id,mid,buy_months,money,status,ver,platform,app_sub_id,bmid,order_type,coupon_money,pid,user_ip)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?);"
  9. _insertOldRechargeOrder = "INSERT INTO vip_recharge_order(app_id,pay_mid,order_no,recharge_bp,pay_order_no,status,remark,ver,third_trade_no)VALUES(?,?,?,?,?,?,?,?,?);"
  10. )
  11. //AddOldPayOrder add old payorder.
  12. func (d *Dao) AddOldPayOrder(c context.Context, r *model.VipOldPayOrder) (err error) {
  13. if _, err = d.olddb.Exec(c, _insertOldPayOrder, &r.OrderNo, &r.AppID, &r.Mid, &r.BuyMonths, &r.Money, &r.Status, &r.Ver, &r.Platform, &r.AppSubID, &r.Bmid,
  14. &r.OrderType, &r.CouponMoney, &r.PID, &r.UserIP); err != nil {
  15. err = errors.Wrapf(err, "dao add old pay order(%+v)", r)
  16. return
  17. }
  18. return
  19. }
  20. //AddOldRechargeOrder add recharge order.
  21. func (d *Dao) AddOldRechargeOrder(c context.Context, r *model.VipOldRechargeOrder) (err error) {
  22. if _, err = d.olddb.Exec(c, _insertOldRechargeOrder, &r.AppID, &r.PayMid, &r.OrderNo, &r.RechargeBp, &r.PayOrderNO, &r.Status, &r.Remark, &r.Ver, &r.ThirdTradeNO); err != nil {
  23. err = errors.Wrapf(err, "dao add old recharge order(%+v)", r)
  24. return
  25. }
  26. return
  27. }