yuleduiPay/repo/pay_order.go

26 lines
640 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("order_id = ?", orderId).Update()
return err
}
func (t *PayOrder) GetPayOrderByOrderId(orderId string) (*po.PayOrder, error) {
payOrder := &po.PayOrder{}
err := g.Model("pay_order").Where("order_id = ?", orderId).Scan(payOrder)
return payOrder, err
}