|
@@ -2,7 +2,7 @@ package models
|
|
|
|
|
|
import (
|
|
|
"fmt"
|
|
|
- "github.com/rdlucklib/rdluck_tools/orm"
|
|
|
+ "github.com/beego/beego/v2/client/orm"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -28,13 +28,24 @@ type CygxActivityAttendanceDetail struct {
|
|
|
//添加会议提醒信息
|
|
|
func AddCygxActivityAttendanceDetail(item *CygxActivityAttendanceDetail) (lastId int64, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
- o.Begin()
|
|
|
+
|
|
|
+ tx, err := o.Begin()
|
|
|
+ //o.Begin()
|
|
|
+ //defer func() {
|
|
|
+ // fmt.Println(err)
|
|
|
+ // if err == nil {
|
|
|
+ // o.C
|
|
|
+ // } else {
|
|
|
+ // o.Rollback()
|
|
|
+ // }
|
|
|
+ //}()
|
|
|
+
|
|
|
defer func() {
|
|
|
fmt.Println(err)
|
|
|
if err == nil {
|
|
|
- o.Commit()
|
|
|
+ tx.Commit()
|
|
|
} else {
|
|
|
- o.Rollback()
|
|
|
+ tx.Rollback()
|
|
|
}
|
|
|
}()
|
|
|
var count int
|
|
@@ -148,8 +159,9 @@ func AddAttendancDetail(items []*CygxActivityAttendanceDetail, activityId int, m
|
|
|
//获取用户报名数量
|
|
|
|
|
|
func GetRoadshowDataList(title, findStartDate, findEndDate string) (list []*RoadshowData, err error) {
|
|
|
- o := orm.NewOrm()
|
|
|
- o.Using("comein_data")
|
|
|
+ //o := orm.NewOrm()
|
|
|
+ o := orm.NewOrmUsingDB("comein_data")
|
|
|
+ //o.Using("comein_data")
|
|
|
sql := `SELECT * FROM roadshow_data WHERE roadshow_title LIKE '%` + title + `%' AND roadshow_begin_time >= '` + findStartDate + `' AND roadshow_begin_time <= '` + findEndDate + `'`
|
|
|
|
|
|
_, err = o.Raw(sql).QueryRows(&list)
|