123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- package models
- import (
- _ "github.com/go-sql-driver/mysql"
- "hongze/hongze_web_mfyx/models/order"
- "hongze/hongze_web_mfyx/utils"
- "time"
- "github.com/beego/beego/v2/client/orm"
- )
- func init() {
- _ = orm.RegisterDataBase("default", "mysql", utils.MYSQL_URL_CYGX)
- orm.SetMaxIdleConns("default", 50)
- orm.SetMaxOpenConns("default", 100)
- cygx_db, _ := orm.GetDB("default")
- cygx_db.SetConnMaxLifetime(10 * time.Minute)
- _ = orm.RegisterDataBase("weekly_report", "mysql", utils.MYSQL_URL)
- orm.SetMaxIdleConns("weekly_report", 50)
- orm.SetMaxOpenConns("weekly_report", 100)
- db, _ := orm.GetDB("weekly_report")
- db.SetConnMaxLifetime(10 * time.Minute)
- _ = orm.RegisterDataBase("rddp", "mysql", utils.MYSQL_URL_RDDP)
- orm.SetMaxIdleConns("rddp", 50)
- orm.SetMaxOpenConns("rddp", 100)
- report_db, _ := orm.GetDB("rddp")
- report_db.SetConnMaxLifetime(10 * time.Minute)
- //注册对象
- orm.RegisterModel(
- new(WxUser),
- new(WxUserCode),
- new(UserRecord),
- new(CygxUserRecord),
- new(CygxMfyxWebSession),
- new(CygxIndustryFllow),
- new(MsgCode),
- new(CygxArticleCollect),
- new(CygxInterviewApply),
- new(CygxArticleAsk),
- new(CygxSearchKeyWord),
- new(CygxSearchKeyWordLog),
- new(Resource),
- new(CygxXzsChooseCategory),
- new(CygxReportIndustrialSeaarchHistory),
- new(CygxMicroRoadshowVideoHistory),
- new(CygxActivitySignup),
- new(CygxActivitySignupLog),
- new(CygxMySchedule),
- new(CygxActivitySpecialSignup),
- new(CygxUserFollowSpecial),
- new(CygxActivitySpecialTrip),
- new(CygxActivityMeetingReminder),
- new(CygxActivityMeetingReminderLog),
- new(CygxActivityAppointment),
- new(CygxActivityHelpAsk),
- new(UserTemplateRecord),
- new(CygxAdvice),
- new(CygxPageHistoryRecord),
- new(CygxArticleDepartmentFollow),
- new(CygxArticleComment),
- new(CygxArticleViewRecord),
- new(CygxArticleHistoryRecordNewpv),
- new(CygxArticleHistoryRecord),
- new(CygxArticleHistoryRecordAll),
- new(CygxActivitySpecialTripBill),
- new(CygxReportHistoryRecord),
- new(CygxReportSelectionSubjectHistory),
- new(CygxMinutesSummaryVoiceHistory),
- new(CygxResearchSummaryVoiceHistory),
- new(CygxProductInteriorHistory),
- new(CygxAboutUsVideoHistory),
- new(CygxTacticsTimeLineHistory),
- new(CygxBannerHistory),
- new(CygxReportHistoryRecordLog),
- new(CygxUserLabel),
- new(CygxInviteCompany),
- new(CygxApplyRecord),
- new(CygxTagHistory),
- new(CygxActivitySpecialMeetingDetail),
- new(CygxActivityVoiceHistory),
- new(CygxApplyCollection),
- new(CygxActivitySpecialInheritPointsCompany),
- new(CygxArticleApplyAppointmentExpert),
- new(CygxBannerYxSurvey),
- new(CygxReportSelectionLogApply),
- new(CygxIndustryFllowLog),
- new(CygxYanxuanSpecialRecord),
- new(CygxYanxuanSpecialRecordLog),
- new(CygxYanxuanSpecialCollect),
- new(CygxYanxuanSpecial),
- new(CygxYanxuanSpecialFollow),
- new(CygxYanxuanSpecialCompany),
- new(CygxYanxuanSpecialApprovalLog),
- new(CygxYanxuanSpecialMessage),
- new(CygxYanxuanSpecialMessageLike),
- new(CygxYanxuanSpecialSpecialLike),
- new(CygxResourceData),
- new(CygxMorningMeetingReviewChapterHistory),
- new(CygxAskserieVideoHistoryRecord),
- new(CygxAskserieVideoCollection),
- new(CygxAskserieVideoCollect),
- new(CygxVoiceAndVideoHistory),
- new(CygxActivityVideoHistory),
- new(CygxUserAdminShareHistory),
- new(CygxUserAdminShareCode),
- new(CygxUserPassword),
- new(CygxActivityVivoPointRecord),
- )
- initOrder() // 订单模块
- // 记录ORM查询日志
- orm.Debug = true
- orm.DebugLog = orm.NewLog(utils.Binlog)
- }
- // initOrder 买方研选订单模块
- func initOrder() {
- orm.RegisterModel(
- new(order.CygxUserBusinessCard), //用户上传名片
- new(order.CygxOrder), //订单表
- new(order.CygxOrderAction), //订单操表
- new(order.CygxOrderUserCard), //用户持卡表
- new(order.CygxOrderUserCardLog), //用户持卡日志表
- new(order.CygxOrderPayment), //支付记录表
- new(order.CygxOrderVirtualAsset), //用户虚拟资产表(所购买的单篇报告,活动等)
- )
- }
|