yuleduiPay/repo/pay_order.go

26 lines
638 B
Go

package repo
import (
"yuleduiPay/service/po"
"github.com/gogf/gf/v2/frame/g"
)
type PayOrder struct {
}
func (t *PayOrder) CreatePayOrder(payOrder *po.PayOrder) error {
_, err := g.Model("pay_order").Data(payOrder).Insert()
return err
}
func (t *PayOrder) UpdatePayOrderByOrderId(updateMap g.Map, orderId string) error {
_, err := g.Model("pay_order").Data(updateMap).Where("orderId = ?", orderId).Update()
return err
}
func (t *PayOrder) GetPayOrderByOrderId(orderId string) (*po.PayOrder, error) {
payOrder := &po.PayOrder{}
err := g.Model("pay_order").Where("orderId = ?", orderId).Scan(payOrder)
return payOrder, err
}