Kaynağa Gözat

Merge branch 'fix_orm_v2' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 3 yıl önce
ebeveyn
işleme
25ae1f2e2a
59 değiştirilmiş dosya ile 133 ekleme ve 106 silme
  1. 1 1
      models/activity.go
  2. 18 6
      models/activity_attendance_detail.go
  3. 1 1
      models/activity_fastsearch_keywords.go
  4. 1 1
      models/activity_help_ask.go
  5. 5 3
      models/activity_meet_detail_log.go
  6. 9 5
      models/activity_meeting_reminder.go
  7. 1 1
      models/activity_mirror_word.go
  8. 1 1
      models/activity_seaarch_history.go
  9. 21 11
      models/activity_signup.go
  10. 1 1
      models/activity_type.go
  11. 5 3
      models/activity_user_search_content.go
  12. 1 1
      models/advice.go
  13. 5 3
      models/apply_record.go
  14. 2 3
      models/article.go
  15. 1 1
      models/article_ask.go
  16. 1 1
      models/article_author.go
  17. 1 1
      models/article_collect.go
  18. 1 1
      models/article_department.go
  19. 1 1
      models/article_department_follow.go
  20. 5 3
      models/article_history_record.go
  21. 1 1
      models/article_history_record_newpv.go
  22. 1 1
      models/article_interview_apply.go
  23. 1 1
      models/article_view_record.go
  24. 1 1
      models/chart_permission.go
  25. 1 1
      models/company.go
  26. 1 1
      models/config.go
  27. 1 1
      models/cygx_industry_top.go
  28. 1 1
      models/cygx_user_record.go
  29. 1 1
      models/db.go
  30. 1 1
      models/db_base.go
  31. 1 1
      models/home.go
  32. 1 1
      models/industrial_management.go
  33. 1 1
      models/industry_fllow.go
  34. 1 1
      models/industry_map.go
  35. 1 1
      models/minutesSummary.go
  36. 3 5
      models/msg_code.go
  37. 1 1
      models/page_history_record.go
  38. 1 1
      models/report.go
  39. 1 1
      models/report_history_record.go
  40. 1 1
      models/report_industrial_seaarch_history.go
  41. 1 1
      models/report_mapping.go
  42. 1 1
      models/report_selection.go
  43. 1 1
      models/researchSummary.go
  44. 3 5
      models/resource.go
  45. 1 1
      models/search.go
  46. 1 1
      models/search_key_word.go
  47. 1 1
      models/seller.go
  48. 1 1
      models/session.go
  49. 5 9
      models/tactics.go
  50. 5 3
      models/user.go
  51. 1 1
      models/user_record.go
  52. 1 1
      models/user_search_key_word.go
  53. 1 1
      models/wechat.go
  54. 1 1
      models/wx_template_msg.go
  55. 1 1
      models/wx_user.go
  56. 1 1
      models/wx_user_code.go
  57. 1 1
      models/wx_user_log.go
  58. 1 1
      models/wx_user_white.go
  59. 1 1
      services/article.go

+ 1 - 1
models/activity.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"time"
 )

+ 18 - 6
models/activity_attendance_detail.go

@@ -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)

+ 1 - 1
models/activity_fastsearch_keywords.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 )
 
 type ActivityFastsearchKeywords struct {

+ 1 - 1
models/activity_help_ask.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 5 - 3
models/activity_meet_detail_log.go

@@ -2,7 +2,7 @@ package models
 
 import (
 	"fmt"
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"strings"
 	"time"
 )
@@ -82,8 +82,10 @@ func UpdateActivityMeetDetailLogByUser(mobile string, num int) (err error) {
 
 //添加线上到会记录
 func AddCygxActivityMeetDetailLogOnline(list []*CygxActivityAttendanceDetail, activityId int) (err error) {
-	o := orm.NewOrm()
-	o.Begin()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
 	defer func() {
 		fmt.Println(err)
 		if err == nil {

+ 9 - 5
models/activity_meeting_reminder.go

@@ -2,7 +2,7 @@ package models
 
 import (
 	"fmt"
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 
@@ -32,8 +32,10 @@ type CygxActivityMeetingReminderLog struct {
 
 //添加会议提醒信息
 func AddActivityMeetingReminder(item *CygxActivityMeetingReminder) (lastId int64, err error) {
-	o := orm.NewOrm()
-	o.Begin()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
 	defer func() {
 		fmt.Println(err)
 		if err == nil {
@@ -97,8 +99,10 @@ func GetActivityMeetingReminderCount(uid, activityId int) (count int, err error)
 
 //取消会议提醒
 func CancelActivityMeetingReminder(item *CygxActivityMeetingReminder) (lastId int64, err error) {
-	o := orm.NewOrm()
-	o.Begin()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
 	defer func() {
 		fmt.Println(err)
 		if err == nil {

+ 1 - 1
models/activity_mirror_word.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 )
 
 type CygxActivityMirrorWord struct {

+ 1 - 1
models/activity_seaarch_history.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 21 - 11
models/activity_signup.go

@@ -2,7 +2,7 @@ package models
 
 import (
 	"fmt"
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 
@@ -69,8 +69,10 @@ type CygxActivitySignupLog struct {
 
 //添加报名信息
 func AddActivitySignup(item *CygxActivitySignup) (lastId int64, err error) {
-	o := orm.NewOrm()
-	o.Begin()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
 	defer func() {
 		fmt.Println(err)
 		if err == nil {
@@ -129,8 +131,10 @@ func AddActivitySignup(item *CygxActivitySignup) (lastId int64, err error) {
 
 //仅绑定邮箱的用户修改报名后,添加报名信息
 func AddActivitySignupFromEmail(item *CygxActivitySignup) (lastId int64, err error) {
-	o := orm.NewOrm()
-	o.Begin()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
 	defer func() {
 		fmt.Println(err)
 		if err == nil {
@@ -194,8 +198,10 @@ func AddActivitySignupFromEmail(item *CygxActivitySignup) (lastId int64, err err
 
 //添加报名信息
 func AddActivitySignupNoSchedule(item *CygxActivitySignup) (lastId int64, err error) {
-	o := orm.NewOrm()
-	o.Begin()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
 	defer func() {
 		fmt.Println(err)
 		if err == nil {
@@ -287,8 +293,10 @@ func GetUserSignupCount(uid int) (count int, err error) {
 
 //取消报名
 func CancelActivitySignup(item *CygxActivitySignup) (lastId int64, err error) {
-	o := orm.NewOrm()
-	o.Begin()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
 	defer func() {
 		fmt.Println(err)
 		if err == nil {
@@ -339,8 +347,10 @@ func GetActivitySignupDetail(activityId, uid int) (item *CygxActivitySignup, err
 
 //解除报名限制之后二次报名
 func AddActivitySignupByRestrict(item *CygxActivitySignup) (lastId int64, err error) {
-	o := orm.NewOrm()
-	o.Begin()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
 	defer func() {
 		fmt.Println(err)
 		if err == nil {

+ 1 - 1
models/activity_type.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 )
 
 type ActivityType struct {

+ 5 - 3
models/activity_user_search_content.go

@@ -2,7 +2,7 @@ package models
 
 import (
 	"fmt"
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 
@@ -23,8 +23,10 @@ type CygxActivityUserSearchContent struct {
 
 //更新搜索信息
 func AddUserSearchContent(item *CygxActivityUserSearchContent, ttlTime time.Duration) (lastId int64, err error) {
-	o := orm.NewOrm()
-	o.Begin()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
 	defer func() {
 		fmt.Println(err)
 		if err == nil {

+ 1 - 1
models/advice.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 5 - 3
models/apply_record.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 
@@ -16,8 +16,10 @@ type CygxApplyRecord struct {
 }
 
 func AddApplyRecord(item *ApplyTryReq, mobile, companyNamePay string, userId, companyIdPay int) (err error) {
-	o := orm.NewOrm()
-	o.Begin()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
 	defer func() {
 		if err != nil {
 			o.Rollback()

+ 2 - 3
models/article.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 
@@ -470,8 +470,7 @@ type ReportDetail struct {
 }
 
 func GetReportList() (items []*ReportDetail, err error) {
-	o := orm.NewOrm()
-	o.Using("rddp")
+	o := orm.NewOrmUsingDB("rddp")
 	sql := `SELECT * FROM report WHERE  classify_id_second = '57'`
 	_, err = o.Raw(sql).QueryRows(&items)
 	return

+ 1 - 1
models/article_ask.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/article_author.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 )
 
 type CygxArticleAuthor struct {

+ 1 - 1
models/article_collect.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/article_department.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"time"
 )

+ 1 - 1
models/article_department_follow.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 5 - 3
models/article_history_record.go

@@ -2,7 +2,7 @@ package models
 
 import (
 	"fmt"
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"hongze/hongze_cygx/utils"
 	"time"
 )
@@ -23,8 +23,10 @@ type CygxArticleHistoryRecord struct {
 
 //添加历史信息
 func AddCygxArticleHistoryRecord(item *CygxArticleHistoryRecord) (lastId int64, err error) {
-	o := orm.NewOrm()
-	o.Begin()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
 	defer func() {
 		fmt.Println(err)
 		if err == nil {

+ 1 - 1
models/article_history_record_newpv.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"strconv"
 	"time"
 )

+ 1 - 1
models/article_interview_apply.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/article_view_record.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/chart_permission.go

@@ -1,6 +1,6 @@
 package models
 
-import "github.com/rdlucklib/rdluck_tools/orm"
+import "github.com/beego/beego/v2/client/orm"
 
 type ChartPermission struct {
 	ChartPermissionId int    `description:"权限id"`

+ 1 - 1
models/company.go

@@ -1,6 +1,6 @@
 package models
 
-import "github.com/rdlucklib/rdluck_tools/orm"
+import "github.com/beego/beego/v2/client/orm"
 
 type CompanyDetail struct {
 	CompanyId   int    `orm:"column(company_id);pk"`

+ 1 - 1
models/config.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/cygx_industry_top.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/cygx_user_record.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/db.go

@@ -5,7 +5,7 @@ import (
 	"hongze/hongze_cygx/utils"
 	"time"
 
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 )
 
 func init() {

+ 1 - 1
models/db_base.go

@@ -3,7 +3,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 )
 
 // 是否存在

+ 1 - 1
models/home.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"github.com/rdlucklib/rdluck_tools/paging"
 )
 

+ 1 - 1
models/industrial_management.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"hongze/hongze_cygx/utils"
 	"strconv"
 	"time"

+ 1 - 1
models/industry_fllow.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/industry_map.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/minutesSummary.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 )
 
 type DetailCygxMinutesSummaryRep struct {

+ 3 - 5
models/msg_code.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 
@@ -18,15 +18,13 @@ type MsgCode struct {
 
 //添加用户session信息
 func AddMsgCode(item *MsgCode) (err error) {
-	o := orm.NewOrm()
-	o.Using("rddp")
+	o := orm.NewOrmUsingDB("rddp")
 	_, err = o.Insert(item)
 	return
 }
 
 func GetMsgCode(mobile, code string) (item *MsgCode, err error) {
-	o := orm.NewOrm()
-	o.Using("rddp")
+	o := orm.NewOrmUsingDB("rddp")
 	sql := `SELECT * FROM msg_code WHERE mobile=? AND code=? AND FROM_UNIXTIME(expired_in)>=NOW() `
 	err = o.Raw(sql, mobile, code).QueryRow(&item)
 	return

+ 1 - 1
models/page_history_record.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/report.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"strconv"
 	//"github.com/rdlucklib/rdluck_tools/paging"

+ 1 - 1
models/report_history_record.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/report_industrial_seaarch_history.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/report_mapping.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 )
 
 type ReportMapping struct {

+ 1 - 1
models/report_selection.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"time"
 )

+ 1 - 1
models/researchSummary.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 3 - 5
models/resource.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 
@@ -19,15 +19,13 @@ type ResourceResp struct {
 }
 
 func AddResource(item *Resource) (newId int64, err error) {
-	o := orm.NewOrm()
-	o.Using("rddp")
+	o := orm.NewOrmUsingDB("rddp")
 	newId, err = o.Insert(item)
 	return
 }
 
 func GetResourceById(id string) (item *Resource, err error) {
-	o := orm.NewOrm()
-	o.Using("rddp")
+	o := orm.NewOrmUsingDB("rddp")
 	sql := "SELECT * FROM resource WHERE id=? "
 	err = o.Raw(sql, id).QueryRow(&item)
 	return

+ 1 - 1
models/search.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"github.com/rdlucklib/rdluck_tools/paging"
 )
 

+ 1 - 1
models/search_key_word.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/seller.go

@@ -1,6 +1,6 @@
 package models
 
-import "github.com/rdlucklib/rdluck_tools/orm"
+import "github.com/beego/beego/v2/client/orm"
 
 type AdminItem struct {
 	AdminId        int    `description:"系统用户id"`

+ 1 - 1
models/session.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 5 - 9
models/tactics.go

@@ -2,7 +2,7 @@ package models
 
 import (
 	"fmt"
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"strconv"
 	"time"
@@ -26,8 +26,7 @@ type Tactics struct {
 }
 
 func GetTacticsList(endDate string) (list []*Tactics, err error) {
-	o := orm.NewOrm()
-	o.Using("tactics")
+	o := orm.NewOrmUsingDB("tactics")
 	sql := `SELECT a.*,b.body,b.abstract,b.annotation,b.article_id,d.category_name,d.sub_category_name,c.category_id
 				FROM article_articleinfo AS a
 				INNER JOIN article_content AS b ON a.id=b.article_id
@@ -40,8 +39,7 @@ func GetTacticsList(endDate string) (list []*Tactics, err error) {
 }
 
 func GetTacticsListAll() (list []*Tactics, err error) {
-	o := orm.NewOrm()
-	o.Using("tactics")
+	o := orm.NewOrmUsingDB("tactics")
 	sql := `SELECT a.*,b.body,b.abstract,b.annotation,b.article_id,d.category_name,d.sub_category_name,c.category_id
 			FROM article_articleinfo AS a
 			INNER JOIN article_content AS b ON a.id=b.article_id
@@ -83,8 +81,7 @@ type Tactics2 struct {
 }
 
 func GetTacticsList2(endDate string) (list []*Tactics2, err error) {
-	o := orm.NewOrm()
-	o.Using("tactics")
+	o := orm.NewOrmUsingDB("tactics")
 	sql := `SELECT a.*,b.body,b.abstract,b.annotation,b.article_id,d.category_name,d.sub_category_name,c.category_id
 			FROM article_articleinfo AS a
 			INNER JOIN article_content AS b ON a.id=b.article_id
@@ -98,8 +95,7 @@ func GetTacticsList2(endDate string) (list []*Tactics2, err error) {
 }
 
 func GetTacticsListAll2() (list []*Tactics2, err error) {
-	o := orm.NewOrm()
-	o.Using("tactics")
+	o := orm.NewOrmUsingDB("tactics")
 	sql := `SELECT a.*,b.body,b.abstract,b.annotation,b.article_id,d.category_name,d.sub_category_name,c.category_id
 			FROM article_articleinfo AS a
 			INNER JOIN article_content AS b ON a.id=b.article_id

+ 5 - 3
models/user.go

@@ -2,7 +2,7 @@ package models
 
 import (
 	"fmt"
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"hongze/hongze_cygx/utils"
 	"time"
@@ -233,8 +233,10 @@ type OutboundMobileItem struct {
 }
 
 func AddOutboundMobile(item *OutboundMobileItem, userId int) (err error) {
-	o := orm.NewOrm()
-	o.Begin()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
 	defer func() {
 		fmt.Println(err)
 		if err == nil {

+ 1 - 1
models/user_record.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/user_search_key_word.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/wechat.go

@@ -3,8 +3,8 @@ package models
 import (
 	"encoding/json"
 	"fmt"
+	"github.com/beego/beego/v2/client/orm"
 	"github.com/rdlucklib/rdluck_tools/http"
-	"github.com/rdlucklib/rdluck_tools/orm"
 	"hongze/hongze_cygx/utils"
 	"strings"
 	"time"

+ 1 - 1
models/wx_template_msg.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 )
 
 type SendTemplateResponse struct {

+ 1 - 1
models/wx_user.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/wx_user_code.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/wx_user_log.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
models/wx_user_white.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"time"
 )
 

+ 1 - 1
services/article.go

@@ -5,7 +5,7 @@ import (
 	"encoding/json"
 	"fmt"
 	"github.com/PuerkitoBio/goquery"
-	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/beego/beego/v2/client/orm"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/utils"
 	"html"