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 {
|
|
|
|
_, 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
|
|
|
|
}
|