代码拉取完成,页面将自动刷新
package repository
import (
"gitee.com/cristiane/micro-mall-pay/model/mysql"
"gitee.com/kelvins-io/kelvins"
"xorm.io/xorm"
)
func CreatePayRecord(tx *xorm.Session, model *mysql.PayRecord) (err error) {
_, err = tx.Table(mysql.TablePayRecord).Insert(model)
return
}
func GetPayRecordList(selectSql string, where interface{}, orderByAsc, orderByDesc []string, pageSize, pageNum int) ([]mysql.PayRecord, int64, error) {
var result = make([]mysql.PayRecord, 0)
session := kelvins.XORM_DBEngine.Table(mysql.TablePayRecord).Select(selectSql).
Where(where).
Asc(orderByAsc...).
Desc(orderByDesc...)
if pageSize > 0 && pageNum >= 1 {
session = session.Limit(pageSize, (pageNum-1)*pageSize)
}
total, err := session.FindAndCount(&result)
return result, total, err
}
func UpdatePayRecord(tx *xorm.Session, where map[string]interface{}, maps map[string]interface{}) (int64, error) {
return tx.Table(mysql.TablePayRecord).Where(where).Update(maps)
}
func FindPayRecordList(selectSql string, where interface{}) ([]mysql.PayRecord, error) {
var result = make([]mysql.PayRecord, 0)
err := kelvins.XORM_DBEngine.Table(mysql.TablePayRecord).Select(selectSql).Where(where).Find(&result)
return result, err
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。