yuleduiPay/repo/pay_order.go

26 lines
640 B
Go
Raw Permalink Normal View History

2024-11-05 08:32:10 +08:00
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
}
2024-11-05 17:34:58 +08:00
func (t *PayOrder) UpdatePayOrderByOrderId(updateMap g.Map, orderId string) error {
2024-11-06 15:15:45 +08:00
_, err := g.Model("pay_order").Data(updateMap).Where("order_id = ?", orderId).Update()
2024-11-05 17:34:58 +08:00
return err
}
func (t *PayOrder) GetPayOrderByOrderId(orderId string) (*po.PayOrder, error) {
payOrder := &po.PayOrder{}
2024-11-06 15:15:45 +08:00
err := g.Model("pay_order").Where("order_id = ?", orderId).Scan(payOrder)
2024-11-05 17:34:58 +08:00
return payOrder, err
}