pay_channel.go 795 B

12345678910111213141516171819202122232425262728293031
  1. package contract
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // PayChannel 支付渠道
  7. type PayChannel struct {
  8. Id int `orm:"column(id);pk"`
  9. PayChannel string `description:"支付渠道,长度32位"`
  10. CreateTime time.Time `description:"添加时间"`
  11. }
  12. // Update 更新支付渠道基础信息
  13. func (payChannel *PayChannel) Update(cols []string) (err error) {
  14. o := orm.NewOrm()
  15. _, err = o.Update(payChannel, cols...)
  16. return
  17. }
  18. // GetPayChannelList 模糊搜索 获取支付渠道列表数据
  19. func GetPayChannelList(keyword string) (list []*PayChannel, err error) {
  20. o := orm.NewOrm()
  21. sql := `select * from pay_channel where 1=1 `
  22. if keyword != "" {
  23. sql += `AND pay_channel like "%` + keyword + `%"`
  24. }
  25. _, err = o.Raw(sql).QueryRows(&list)
  26. return
  27. }