gen.go 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845
  1. // Code generated by gorm.io/gen. DO NOT EDIT.
  2. // Code generated by gorm.io/gen. DO NOT EDIT.
  3. // Code generated by gorm.io/gen. DO NOT EDIT.
  4. package query
  5. import (
  6. "context"
  7. "database/sql"
  8. "gorm.io/gorm"
  9. "gorm.io/gen"
  10. "gorm.io/plugin/dbresolver"
  11. )
  12. func Use(db *gorm.DB, opts ...gen.DOOption) *Query {
  13. return &Query{
  14. db: db,
  15. AdminMenu: newAdminMenu(db, opts...),
  16. AdminRoleMenu: newAdminRoleMenu(db, opts...),
  17. AdminRolePermission: newAdminRolePermission(db, opts...),
  18. AdminPermission: newAdminPermission(db, opts...),
  19. AdminOperation: newAdminOperation(db, opts...),
  20. AdminSystem: newAdminSystem(db, opts...),
  21. AdminEmail: newAdminEmail(db, opts...),
  22. AdminLog: newAdminLog(db, opts...),
  23. AdminNotice: newAdminNotice(db, opts...),
  24. AdminRole: newAdminRole(db, opts...),
  25. AdminUser: newAdminUser(db, opts...),
  26. AdvOriginLog: newAdvOriginLog(db, opts...),
  27. AdvertisementLog: newAdvertisementLog(db, opts...),
  28. AdvertisementSpace: newAdvertisementSpace(db, opts...),
  29. BossLog: newBossLog(db, opts...),
  30. Bosswar: newBosswar(db, opts...),
  31. BuyStamina: newBuyStamina(db, opts...),
  32. Cache: newCache(db, opts...),
  33. ChangedLog: newChangedLog(db, opts...),
  34. ChangedPlayer: newChangedPlayer(db, opts...),
  35. ChangedStatistic: newChangedStatistic(db, opts...),
  36. ChangedSync: newChangedSync(db, opts...),
  37. Channel: newChannel(db, opts...),
  38. Chapter: newChapter(db, opts...),
  39. ChapterLog: newChapterLog(db, opts...),
  40. ChapterLogsUserDetail: newChapterLogsUserDetail(db, opts...),
  41. ChapterSync: newChapterSync(db, opts...),
  42. ClientDatum: newClientDatum(db, opts...),
  43. Climbfloor: newClimbfloor(db, opts...),
  44. Config: newConfig(db, opts...),
  45. Curiomake: newCuriomake(db, opts...),
  46. CustomerServiceChatLog: newCustomerServiceChatLog(db, opts...),
  47. DisconnectLog: newDisconnectLog(db, opts...),
  48. DuelLog: newDuelLog(db, opts...),
  49. EventConfig: newEventConfig(db, opts...),
  50. ExpeditionLog: newExpeditionLog(db, opts...),
  51. FirstAdvLog: newFirstAdvLog(db, opts...),
  52. GameAlarmCombatLog: newGameAlarmCombatLog(db, opts...),
  53. GameCharacterDataAnomaly: newGameCharacterDataAnomaly(db, opts...),
  54. GameDataAlarm: newGameDataAlarm(db, opts...),
  55. GemLog: newGemLog(db, opts...),
  56. GemPlayer: newGemPlayer(db, opts...),
  57. GemStat: newGemStat(db, opts...),
  58. Globalletter: newGloballetter(db, opts...),
  59. GoodsLog: newGoodsLog(db, opts...),
  60. Grandmaster: newGrandmaster(db, opts...),
  61. GrandmasterLog: newGrandmasterLog(db, opts...),
  62. GrandmasterMatch: newGrandmasterMatch(db, opts...),
  63. GudongLog: newGudongLog(db, opts...),
  64. IdiomLog: newIdiomLog(db, opts...),
  65. Idiommatch: newIdiommatch(db, opts...),
  66. Lady38rank2: newLady38rank2(db, opts...),
  67. LimitgiftLog: newLimitgiftLog(db, opts...),
  68. LoginLog: newLoginLog(db, opts...),
  69. Menu: newMenu(db, opts...),
  70. NewConvLog: newNewConvLog(db, opts...),
  71. OnlineDurationLog: newOnlineDurationLog(db, opts...),
  72. OnlineNumsLog: newOnlineNumsLog(db, opts...),
  73. Order: newOrder(db, opts...),
  74. OrdersRegStat: newOrdersRegStat(db, opts...),
  75. OrdersSettle: newOrdersSettle(db, opts...),
  76. OrdersSync: newOrdersSync(db, opts...),
  77. PayOrderAndriod: newPayOrderAndriod(db, opts...),
  78. PayOrderIos: newPayOrderIos(db, opts...),
  79. PlayerAttr: newPlayerAttr(db, opts...),
  80. PlayerBanLog: newPlayerBanLog(db, opts...),
  81. PlayerBattleDp: newPlayerBattleDp(db, opts...),
  82. PlayerCache: newPlayerCache(db, opts...),
  83. PlayerChannel: newPlayerChannel(db, opts...),
  84. PlayerDayTask: newPlayerDayTask(db, opts...),
  85. PlayerDivination: newPlayerDivination(db, opts...),
  86. PlayerDp: newPlayerDp(db, opts...),
  87. PlayerLetter: newPlayerLetter(db, opts...),
  88. PlayerLogin: newPlayerLogin(db, opts...),
  89. PlayerMailbox: newPlayerMailbox(db, opts...),
  90. PlayerMaterial: newPlayerMaterial(db, opts...),
  91. PlayerPatrol: newPlayerPatrol(db, opts...),
  92. PlayerTask: newPlayerTask(db, opts...),
  93. Processaward: newProcessaward(db, opts...),
  94. RedeemCode: newRedeemCode(db, opts...),
  95. RedeemPeripheralsReceived: newRedeemPeripheralsReceived(db, opts...),
  96. RedeemReceived: newRedeemReceived(db, opts...),
  97. ReportDayAdvBasic: newReportDayAdvBasic(db, opts...),
  98. ReportDayAdvSumm: newReportDayAdvSumm(db, opts...),
  99. ReportDayBasic: newReportDayBasic(db, opts...),
  100. ReportDayBoss: newReportDayBoss(db, opts...),
  101. ReportDayChapterPass: newReportDayChapterPass(db, opts...),
  102. ReportDayDisconnect: newReportDayDisconnect(db, opts...),
  103. ReportDayDuel: newReportDayDuel(db, opts...),
  104. ReportDayEventBasic: newReportDayEventBasic(db, opts...),
  105. ReportDayExpedition: newReportDayExpedition(db, opts...),
  106. ReportDayFirstAdv: newReportDayFirstAdv(db, opts...),
  107. ReportDayGem: newReportDayGem(db, opts...),
  108. ReportDayGoodsBasic: newReportDayGoodsBasic(db, opts...),
  109. ReportDayGrandmaster: newReportDayGrandmaster(db, opts...),
  110. ReportDayGudong: newReportDayGudong(db, opts...),
  111. ReportDayHaveRole: newReportDayHaveRole(db, opts...),
  112. ReportDayIdiom: newReportDayIdiom(db, opts...),
  113. ReportDayLimitgift: newReportDayLimitgift(db, opts...),
  114. ReportDayNewConv: newReportDayNewConv(db, opts...),
  115. ReportDaySeven: newReportDaySeven(db, opts...),
  116. ReportDayTreasure: newReportDayTreasure(db, opts...),
  117. ReportDayTreasureChest: newReportDayTreasureChest(db, opts...),
  118. ReportEvent: newReportEvent(db, opts...),
  119. ReportLevelOutput: newReportLevelOutput(db, opts...),
  120. Retrofit: newRetrofit(db, opts...),
  121. RetrofitGroup: newRetrofitGroup(db, opts...),
  122. Role: newRole(db, opts...),
  123. RolesLog: newRolesLog(db, opts...),
  124. ServerDeploy: newServerDeploy(db, opts...),
  125. ServerDeployLog: newServerDeployLog(db, opts...),
  126. ServerDeployStat: newServerDeployStat(db, opts...),
  127. ServerOption: newServerOption(db, opts...),
  128. SevenLog: newSevenLog(db, opts...),
  129. Signin: newSignin(db, opts...),
  130. ToolsRestartLog: newToolsRestartLog(db, opts...),
  131. TreasureChestLog: newTreasureChestLog(db, opts...),
  132. TreasureLog: newTreasureLog(db, opts...),
  133. UserAccount: newUserAccount(db, opts...),
  134. UserChapterLog: newUserChapterLog(db, opts...),
  135. WxpayOrder: newWxpayOrder(db, opts...),
  136. WxpayPlayer: newWxpayPlayer(db, opts...),
  137. ZoneActivity: newZoneActivity(db, opts...),
  138. Chat: newChat(db, opts...),
  139. AdminBanUserLog: newAdminBanUserLog(db, opts...),
  140. ChatReportLog: newChatReportLog(db, opts...),
  141. ChatMsgLog: newChatMsgLog(db, opts...),
  142. }
  143. }
  144. type Query struct {
  145. db *gorm.DB
  146. AdminMenu adminMenu
  147. AdminRoleMenu adminRoleMenu
  148. AdminRolePermission adminRolePermission
  149. AdminPermission adminPermission
  150. AdminOperation adminOperation
  151. AdminSystem adminSystem
  152. AdminEmail adminEmail
  153. AdminLog adminLog
  154. AdminNotice adminNotice
  155. AdminRole adminRole
  156. AdminUser adminUser
  157. AdvOriginLog advOriginLog
  158. AdvertisementLog advertisementLog
  159. AdvertisementSpace advertisementSpace
  160. BossLog bossLog
  161. Bosswar bosswar
  162. BuyStamina buyStamina
  163. Cache cache
  164. ChangedLog changedLog
  165. ChangedPlayer changedPlayer
  166. ChangedStatistic changedStatistic
  167. ChangedSync changedSync
  168. Channel channel
  169. Chapter chapter
  170. ChapterLog chapterLog
  171. ChapterLogsUserDetail chapterLogsUserDetail
  172. ChapterSync chapterSync
  173. ClientDatum clientDatum
  174. Climbfloor climbfloor
  175. Config config
  176. Curiomake curiomake
  177. CustomerServiceChatLog customerServiceChatLog
  178. DisconnectLog disconnectLog
  179. DuelLog duelLog
  180. EventConfig eventConfig
  181. ExpeditionLog expeditionLog
  182. FirstAdvLog firstAdvLog
  183. GameAlarmCombatLog gameAlarmCombatLog
  184. GameCharacterDataAnomaly gameCharacterDataAnomaly
  185. GameDataAlarm gameDataAlarm
  186. GemLog gemLog
  187. GemPlayer gemPlayer
  188. GemStat gemStat
  189. Globalletter globalletter
  190. GoodsLog goodsLog
  191. Grandmaster grandmaster
  192. GrandmasterLog grandmasterLog
  193. GrandmasterMatch grandmasterMatch
  194. GudongLog gudongLog
  195. IdiomLog idiomLog
  196. Idiommatch idiommatch
  197. Lady38rank2 lady38rank2
  198. LimitgiftLog limitgiftLog
  199. LoginLog loginLog
  200. Menu menu
  201. NewConvLog newConvLog
  202. OnlineDurationLog onlineDurationLog
  203. OnlineNumsLog onlineNumsLog
  204. Order order
  205. OrdersRegStat ordersRegStat
  206. OrdersSettle ordersSettle
  207. OrdersSync ordersSync
  208. PayOrderAndriod payOrderAndriod
  209. PayOrderIos payOrderIos
  210. PlayerAttr playerAttr
  211. PlayerBanLog playerBanLog
  212. PlayerBattleDp playerBattleDp
  213. PlayerCache playerCache
  214. PlayerChannel playerChannel
  215. PlayerDayTask playerDayTask
  216. PlayerDivination playerDivination
  217. PlayerDp playerDp
  218. PlayerLetter playerLetter
  219. PlayerLogin playerLogin
  220. PlayerMailbox playerMailbox
  221. PlayerMaterial playerMaterial
  222. PlayerPatrol playerPatrol
  223. PlayerTask playerTask
  224. Processaward processaward
  225. RedeemCode redeemCode
  226. RedeemPeripheralsReceived redeemPeripheralsReceived
  227. RedeemReceived redeemReceived
  228. ReportDayAdvBasic reportDayAdvBasic
  229. ReportDayAdvSumm reportDayAdvSumm
  230. ReportDayBasic reportDayBasic
  231. ReportDayBoss reportDayBoss
  232. ReportDayChapterPass reportDayChapterPass
  233. ReportDayDisconnect reportDayDisconnect
  234. ReportDayDuel reportDayDuel
  235. ReportDayEventBasic reportDayEventBasic
  236. ReportDayExpedition reportDayExpedition
  237. ReportDayFirstAdv reportDayFirstAdv
  238. ReportDayGem reportDayGem
  239. ReportDayGoodsBasic reportDayGoodsBasic
  240. ReportDayGrandmaster reportDayGrandmaster
  241. ReportDayGudong reportDayGudong
  242. ReportDayHaveRole reportDayHaveRole
  243. ReportDayIdiom reportDayIdiom
  244. ReportDayLimitgift reportDayLimitgift
  245. ReportDayNewConv reportDayNewConv
  246. ReportDaySeven reportDaySeven
  247. ReportDayTreasure reportDayTreasure
  248. ReportDayTreasureChest reportDayTreasureChest
  249. ReportEvent reportEvent
  250. ReportLevelOutput reportLevelOutput
  251. Retrofit retrofit
  252. RetrofitGroup retrofitGroup
  253. Role role
  254. RolesLog rolesLog
  255. ServerDeploy serverDeploy
  256. ServerDeployLog serverDeployLog
  257. ServerDeployStat serverDeployStat
  258. ServerOption serverOption
  259. SevenLog sevenLog
  260. Signin signin
  261. ToolsRestartLog toolsRestartLog
  262. TreasureChestLog treasureChestLog
  263. TreasureLog treasureLog
  264. UserAccount userAccount
  265. UserChapterLog userChapterLog
  266. WxpayOrder wxpayOrder
  267. WxpayPlayer wxpayPlayer
  268. ZoneActivity zoneActivity
  269. Chat chat
  270. AdminBanUserLog adminBanUserLog
  271. ChatReportLog chatReportLog
  272. ChatMsgLog chatMsgLog
  273. }
  274. func (q *Query) Available() bool { return q.db != nil }
  275. func (q *Query) clone(db *gorm.DB) *Query {
  276. return &Query{
  277. db: db,
  278. AdminMenu: q.AdminMenu.clone(db),
  279. AdminRoleMenu: q.AdminRoleMenu.clone(db),
  280. AdminRolePermission: q.AdminRolePermission.clone(db),
  281. AdminPermission: q.AdminPermission.clone(db),
  282. AdminOperation: q.AdminOperation.clone(db),
  283. AdminSystem: q.AdminSystem.clone(db),
  284. AdminEmail: q.AdminEmail.clone(db),
  285. AdminLog: q.AdminLog.clone(db),
  286. AdminNotice: q.AdminNotice.clone(db),
  287. AdminRole: q.AdminRole.clone(db),
  288. AdminUser: q.AdminUser.clone(db),
  289. AdvOriginLog: q.AdvOriginLog.clone(db),
  290. AdvertisementLog: q.AdvertisementLog.clone(db),
  291. AdvertisementSpace: q.AdvertisementSpace.clone(db),
  292. BossLog: q.BossLog.clone(db),
  293. Bosswar: q.Bosswar.clone(db),
  294. BuyStamina: q.BuyStamina.clone(db),
  295. Cache: q.Cache.clone(db),
  296. ChangedLog: q.ChangedLog.clone(db),
  297. ChangedPlayer: q.ChangedPlayer.clone(db),
  298. ChangedStatistic: q.ChangedStatistic.clone(db),
  299. ChangedSync: q.ChangedSync.clone(db),
  300. Channel: q.Channel.clone(db),
  301. Chapter: q.Chapter.clone(db),
  302. ChapterLog: q.ChapterLog.clone(db),
  303. ChapterLogsUserDetail: q.ChapterLogsUserDetail.clone(db),
  304. ChapterSync: q.ChapterSync.clone(db),
  305. ClientDatum: q.ClientDatum.clone(db),
  306. Climbfloor: q.Climbfloor.clone(db),
  307. Config: q.Config.clone(db),
  308. Curiomake: q.Curiomake.clone(db),
  309. CustomerServiceChatLog: q.CustomerServiceChatLog.clone(db),
  310. DisconnectLog: q.DisconnectLog.clone(db),
  311. DuelLog: q.DuelLog.clone(db),
  312. EventConfig: q.EventConfig.clone(db),
  313. ExpeditionLog: q.ExpeditionLog.clone(db),
  314. FirstAdvLog: q.FirstAdvLog.clone(db),
  315. GameAlarmCombatLog: q.GameAlarmCombatLog.clone(db),
  316. GameCharacterDataAnomaly: q.GameCharacterDataAnomaly.clone(db),
  317. GameDataAlarm: q.GameDataAlarm.clone(db),
  318. GemLog: q.GemLog.clone(db),
  319. GemPlayer: q.GemPlayer.clone(db),
  320. GemStat: q.GemStat.clone(db),
  321. Globalletter: q.Globalletter.clone(db),
  322. GoodsLog: q.GoodsLog.clone(db),
  323. Grandmaster: q.Grandmaster.clone(db),
  324. GrandmasterLog: q.GrandmasterLog.clone(db),
  325. GrandmasterMatch: q.GrandmasterMatch.clone(db),
  326. GudongLog: q.GudongLog.clone(db),
  327. IdiomLog: q.IdiomLog.clone(db),
  328. Idiommatch: q.Idiommatch.clone(db),
  329. Lady38rank2: q.Lady38rank2.clone(db),
  330. LimitgiftLog: q.LimitgiftLog.clone(db),
  331. LoginLog: q.LoginLog.clone(db),
  332. Menu: q.Menu.clone(db),
  333. NewConvLog: q.NewConvLog.clone(db),
  334. OnlineDurationLog: q.OnlineDurationLog.clone(db),
  335. OnlineNumsLog: q.OnlineNumsLog.clone(db),
  336. Order: q.Order.clone(db),
  337. OrdersRegStat: q.OrdersRegStat.clone(db),
  338. OrdersSettle: q.OrdersSettle.clone(db),
  339. OrdersSync: q.OrdersSync.clone(db),
  340. PayOrderAndriod: q.PayOrderAndriod.clone(db),
  341. PayOrderIos: q.PayOrderIos.clone(db),
  342. PlayerAttr: q.PlayerAttr.clone(db),
  343. PlayerBanLog: q.PlayerBanLog.clone(db),
  344. PlayerBattleDp: q.PlayerBattleDp.clone(db),
  345. PlayerCache: q.PlayerCache.clone(db),
  346. PlayerChannel: q.PlayerChannel.clone(db),
  347. PlayerDayTask: q.PlayerDayTask.clone(db),
  348. PlayerDivination: q.PlayerDivination.clone(db),
  349. PlayerDp: q.PlayerDp.clone(db),
  350. PlayerLetter: q.PlayerLetter.clone(db),
  351. PlayerLogin: q.PlayerLogin.clone(db),
  352. PlayerMailbox: q.PlayerMailbox.clone(db),
  353. PlayerMaterial: q.PlayerMaterial.clone(db),
  354. PlayerPatrol: q.PlayerPatrol.clone(db),
  355. PlayerTask: q.PlayerTask.clone(db),
  356. Processaward: q.Processaward.clone(db),
  357. RedeemCode: q.RedeemCode.clone(db),
  358. RedeemPeripheralsReceived: q.RedeemPeripheralsReceived.clone(db),
  359. RedeemReceived: q.RedeemReceived.clone(db),
  360. ReportDayAdvBasic: q.ReportDayAdvBasic.clone(db),
  361. ReportDayAdvSumm: q.ReportDayAdvSumm.clone(db),
  362. ReportDayBasic: q.ReportDayBasic.clone(db),
  363. ReportDayBoss: q.ReportDayBoss.clone(db),
  364. ReportDayChapterPass: q.ReportDayChapterPass.clone(db),
  365. ReportDayDisconnect: q.ReportDayDisconnect.clone(db),
  366. ReportDayDuel: q.ReportDayDuel.clone(db),
  367. ReportDayEventBasic: q.ReportDayEventBasic.clone(db),
  368. ReportDayExpedition: q.ReportDayExpedition.clone(db),
  369. ReportDayFirstAdv: q.ReportDayFirstAdv.clone(db),
  370. ReportDayGem: q.ReportDayGem.clone(db),
  371. ReportDayGoodsBasic: q.ReportDayGoodsBasic.clone(db),
  372. ReportDayGrandmaster: q.ReportDayGrandmaster.clone(db),
  373. ReportDayGudong: q.ReportDayGudong.clone(db),
  374. ReportDayHaveRole: q.ReportDayHaveRole.clone(db),
  375. ReportDayIdiom: q.ReportDayIdiom.clone(db),
  376. ReportDayLimitgift: q.ReportDayLimitgift.clone(db),
  377. ReportDayNewConv: q.ReportDayNewConv.clone(db),
  378. ReportDaySeven: q.ReportDaySeven.clone(db),
  379. ReportDayTreasure: q.ReportDayTreasure.clone(db),
  380. ReportDayTreasureChest: q.ReportDayTreasureChest.clone(db),
  381. ReportEvent: q.ReportEvent.clone(db),
  382. ReportLevelOutput: q.ReportLevelOutput.clone(db),
  383. Retrofit: q.Retrofit.clone(db),
  384. RetrofitGroup: q.RetrofitGroup.clone(db),
  385. Role: q.Role.clone(db),
  386. RolesLog: q.RolesLog.clone(db),
  387. ServerDeploy: q.ServerDeploy.clone(db),
  388. ServerDeployLog: q.ServerDeployLog.clone(db),
  389. ServerDeployStat: q.ServerDeployStat.clone(db),
  390. ServerOption: q.ServerOption.clone(db),
  391. SevenLog: q.SevenLog.clone(db),
  392. Signin: q.Signin.clone(db),
  393. ToolsRestartLog: q.ToolsRestartLog.clone(db),
  394. TreasureChestLog: q.TreasureChestLog.clone(db),
  395. TreasureLog: q.TreasureLog.clone(db),
  396. UserAccount: q.UserAccount.clone(db),
  397. UserChapterLog: q.UserChapterLog.clone(db),
  398. WxpayOrder: q.WxpayOrder.clone(db),
  399. WxpayPlayer: q.WxpayPlayer.clone(db),
  400. ZoneActivity: q.ZoneActivity.clone(db),
  401. Chat: q.Chat.clone(db),
  402. AdminBanUserLog: q.AdminBanUserLog.clone(db),
  403. ChatReportLog: q.ChatReportLog.clone(db),
  404. ChatMsgLog: q.ChatMsgLog.clone(db),
  405. }
  406. }
  407. func (q *Query) ReadDB() *Query {
  408. return q.clone(q.db.Clauses(dbresolver.Read))
  409. }
  410. func (q *Query) WriteDB() *Query {
  411. return q.clone(q.db.Clauses(dbresolver.Write))
  412. }
  413. func (q *Query) ReplaceDB(db *gorm.DB) *Query {
  414. return &Query{
  415. db: db,
  416. AdminMenu: q.AdminMenu.replaceDB(db),
  417. AdminRoleMenu: q.AdminRoleMenu.replaceDB(db),
  418. AdminRolePermission: q.AdminRolePermission.replaceDB(db),
  419. AdminPermission: q.AdminPermission.replaceDB(db),
  420. AdminOperation: q.AdminOperation.replaceDB(db),
  421. AdminSystem: q.AdminSystem.replaceDB(db),
  422. AdminEmail: q.AdminEmail.replaceDB(db),
  423. AdminLog: q.AdminLog.replaceDB(db),
  424. AdminNotice: q.AdminNotice.replaceDB(db),
  425. AdminRole: q.AdminRole.replaceDB(db),
  426. AdminUser: q.AdminUser.replaceDB(db),
  427. AdvOriginLog: q.AdvOriginLog.replaceDB(db),
  428. AdvertisementLog: q.AdvertisementLog.replaceDB(db),
  429. AdvertisementSpace: q.AdvertisementSpace.replaceDB(db),
  430. BossLog: q.BossLog.replaceDB(db),
  431. Bosswar: q.Bosswar.replaceDB(db),
  432. BuyStamina: q.BuyStamina.replaceDB(db),
  433. Cache: q.Cache.replaceDB(db),
  434. ChangedLog: q.ChangedLog.replaceDB(db),
  435. ChangedPlayer: q.ChangedPlayer.replaceDB(db),
  436. ChangedStatistic: q.ChangedStatistic.replaceDB(db),
  437. ChangedSync: q.ChangedSync.replaceDB(db),
  438. Channel: q.Channel.replaceDB(db),
  439. Chapter: q.Chapter.replaceDB(db),
  440. ChapterLog: q.ChapterLog.replaceDB(db),
  441. ChapterLogsUserDetail: q.ChapterLogsUserDetail.replaceDB(db),
  442. ChapterSync: q.ChapterSync.replaceDB(db),
  443. ClientDatum: q.ClientDatum.replaceDB(db),
  444. Climbfloor: q.Climbfloor.replaceDB(db),
  445. Config: q.Config.replaceDB(db),
  446. Curiomake: q.Curiomake.replaceDB(db),
  447. CustomerServiceChatLog: q.CustomerServiceChatLog.replaceDB(db),
  448. DisconnectLog: q.DisconnectLog.replaceDB(db),
  449. DuelLog: q.DuelLog.replaceDB(db),
  450. EventConfig: q.EventConfig.replaceDB(db),
  451. ExpeditionLog: q.ExpeditionLog.replaceDB(db),
  452. FirstAdvLog: q.FirstAdvLog.replaceDB(db),
  453. GameAlarmCombatLog: q.GameAlarmCombatLog.replaceDB(db),
  454. GameCharacterDataAnomaly: q.GameCharacterDataAnomaly.replaceDB(db),
  455. GameDataAlarm: q.GameDataAlarm.replaceDB(db),
  456. GemLog: q.GemLog.replaceDB(db),
  457. GemPlayer: q.GemPlayer.replaceDB(db),
  458. GemStat: q.GemStat.replaceDB(db),
  459. Globalletter: q.Globalletter.replaceDB(db),
  460. GoodsLog: q.GoodsLog.replaceDB(db),
  461. Grandmaster: q.Grandmaster.replaceDB(db),
  462. GrandmasterLog: q.GrandmasterLog.replaceDB(db),
  463. GrandmasterMatch: q.GrandmasterMatch.replaceDB(db),
  464. GudongLog: q.GudongLog.replaceDB(db),
  465. IdiomLog: q.IdiomLog.replaceDB(db),
  466. Idiommatch: q.Idiommatch.replaceDB(db),
  467. Lady38rank2: q.Lady38rank2.replaceDB(db),
  468. LimitgiftLog: q.LimitgiftLog.replaceDB(db),
  469. LoginLog: q.LoginLog.replaceDB(db),
  470. Menu: q.Menu.replaceDB(db),
  471. NewConvLog: q.NewConvLog.replaceDB(db),
  472. OnlineDurationLog: q.OnlineDurationLog.replaceDB(db),
  473. OnlineNumsLog: q.OnlineNumsLog.replaceDB(db),
  474. Order: q.Order.replaceDB(db),
  475. OrdersRegStat: q.OrdersRegStat.replaceDB(db),
  476. OrdersSettle: q.OrdersSettle.replaceDB(db),
  477. OrdersSync: q.OrdersSync.replaceDB(db),
  478. PayOrderAndriod: q.PayOrderAndriod.replaceDB(db),
  479. PayOrderIos: q.PayOrderIos.replaceDB(db),
  480. PlayerAttr: q.PlayerAttr.replaceDB(db),
  481. PlayerBanLog: q.PlayerBanLog.replaceDB(db),
  482. PlayerBattleDp: q.PlayerBattleDp.replaceDB(db),
  483. PlayerCache: q.PlayerCache.replaceDB(db),
  484. PlayerChannel: q.PlayerChannel.replaceDB(db),
  485. PlayerDayTask: q.PlayerDayTask.replaceDB(db),
  486. PlayerDivination: q.PlayerDivination.replaceDB(db),
  487. PlayerDp: q.PlayerDp.replaceDB(db),
  488. PlayerLetter: q.PlayerLetter.replaceDB(db),
  489. PlayerLogin: q.PlayerLogin.replaceDB(db),
  490. PlayerMailbox: q.PlayerMailbox.replaceDB(db),
  491. PlayerMaterial: q.PlayerMaterial.replaceDB(db),
  492. PlayerPatrol: q.PlayerPatrol.replaceDB(db),
  493. PlayerTask: q.PlayerTask.replaceDB(db),
  494. Processaward: q.Processaward.replaceDB(db),
  495. RedeemCode: q.RedeemCode.replaceDB(db),
  496. RedeemPeripheralsReceived: q.RedeemPeripheralsReceived.replaceDB(db),
  497. RedeemReceived: q.RedeemReceived.replaceDB(db),
  498. ReportDayAdvBasic: q.ReportDayAdvBasic.replaceDB(db),
  499. ReportDayAdvSumm: q.ReportDayAdvSumm.replaceDB(db),
  500. ReportDayBasic: q.ReportDayBasic.replaceDB(db),
  501. ReportDayBoss: q.ReportDayBoss.replaceDB(db),
  502. ReportDayChapterPass: q.ReportDayChapterPass.replaceDB(db),
  503. ReportDayDisconnect: q.ReportDayDisconnect.replaceDB(db),
  504. ReportDayDuel: q.ReportDayDuel.replaceDB(db),
  505. ReportDayEventBasic: q.ReportDayEventBasic.replaceDB(db),
  506. ReportDayExpedition: q.ReportDayExpedition.replaceDB(db),
  507. ReportDayFirstAdv: q.ReportDayFirstAdv.replaceDB(db),
  508. ReportDayGem: q.ReportDayGem.replaceDB(db),
  509. ReportDayGoodsBasic: q.ReportDayGoodsBasic.replaceDB(db),
  510. ReportDayGrandmaster: q.ReportDayGrandmaster.replaceDB(db),
  511. ReportDayGudong: q.ReportDayGudong.replaceDB(db),
  512. ReportDayHaveRole: q.ReportDayHaveRole.replaceDB(db),
  513. ReportDayIdiom: q.ReportDayIdiom.replaceDB(db),
  514. ReportDayLimitgift: q.ReportDayLimitgift.replaceDB(db),
  515. ReportDayNewConv: q.ReportDayNewConv.replaceDB(db),
  516. ReportDaySeven: q.ReportDaySeven.replaceDB(db),
  517. ReportDayTreasure: q.ReportDayTreasure.replaceDB(db),
  518. ReportDayTreasureChest: q.ReportDayTreasureChest.replaceDB(db),
  519. ReportEvent: q.ReportEvent.replaceDB(db),
  520. ReportLevelOutput: q.ReportLevelOutput.replaceDB(db),
  521. Retrofit: q.Retrofit.replaceDB(db),
  522. RetrofitGroup: q.RetrofitGroup.replaceDB(db),
  523. Role: q.Role.replaceDB(db),
  524. RolesLog: q.RolesLog.replaceDB(db),
  525. ServerDeploy: q.ServerDeploy.replaceDB(db),
  526. ServerDeployLog: q.ServerDeployLog.replaceDB(db),
  527. ServerDeployStat: q.ServerDeployStat.replaceDB(db),
  528. ServerOption: q.ServerOption.replaceDB(db),
  529. SevenLog: q.SevenLog.replaceDB(db),
  530. Signin: q.Signin.replaceDB(db),
  531. ToolsRestartLog: q.ToolsRestartLog.replaceDB(db),
  532. TreasureChestLog: q.TreasureChestLog.replaceDB(db),
  533. TreasureLog: q.TreasureLog.replaceDB(db),
  534. UserAccount: q.UserAccount.replaceDB(db),
  535. UserChapterLog: q.UserChapterLog.replaceDB(db),
  536. WxpayOrder: q.WxpayOrder.replaceDB(db),
  537. WxpayPlayer: q.WxpayPlayer.replaceDB(db),
  538. ZoneActivity: q.ZoneActivity.replaceDB(db),
  539. Chat: q.Chat.replaceDB(db),
  540. AdminBanUserLog: q.AdminBanUserLog.replaceDB(db),
  541. ChatReportLog: q.ChatReportLog.replaceDB(db),
  542. ChatMsgLog: q.ChatMsgLog.replaceDB(db),
  543. }
  544. }
  545. type queryCtx struct {
  546. AdminMenu *adminMenuDo
  547. AdminRoleMenu *adminRoleMenuDo
  548. AdminRolePermission *adminRolePermissionDo
  549. AdminPermission *adminPermissionDo
  550. AdminOperation *adminOperationDo
  551. AdminSystem *adminSystemDo
  552. AdminEmail *adminEmailDo
  553. AdminLog *adminLogDo
  554. AdminNotice *adminNoticeDo
  555. AdminRole *adminRoleDo
  556. AdminUser *adminUserDo
  557. AdvOriginLog *advOriginLogDo
  558. AdvertisementLog *advertisementLogDo
  559. AdvertisementSpace *advertisementSpaceDo
  560. BossLog *bossLogDo
  561. Bosswar *bosswarDo
  562. BuyStamina *buyStaminaDo
  563. Cache *cacheDo
  564. ChangedLog *changedLogDo
  565. ChangedPlayer *changedPlayerDo
  566. ChangedStatistic *changedStatisticDo
  567. ChangedSync *changedSyncDo
  568. Channel *channelDo
  569. Chapter *chapterDo
  570. ChapterLog *chapterLogDo
  571. ChapterLogsUserDetail *chapterLogsUserDetailDo
  572. ChapterSync *chapterSyncDo
  573. ClientDatum *clientDatumDo
  574. Climbfloor *climbfloorDo
  575. Config *configDo
  576. Curiomake *curiomakeDo
  577. CustomerServiceChatLog *customerServiceChatLogDo
  578. DisconnectLog *disconnectLogDo
  579. DuelLog *duelLogDo
  580. EventConfig *eventConfigDo
  581. ExpeditionLog *expeditionLogDo
  582. FirstAdvLog *firstAdvLogDo
  583. GameAlarmCombatLog *gameAlarmCombatLogDo
  584. GameCharacterDataAnomaly *gameCharacterDataAnomalyDo
  585. GameDataAlarm *gameDataAlarmDo
  586. GemLog *gemLogDo
  587. GemPlayer *gemPlayerDo
  588. GemStat *gemStatDo
  589. Globalletter *globalletterDo
  590. GoodsLog *goodsLogDo
  591. Grandmaster *grandmasterDo
  592. GrandmasterLog *grandmasterLogDo
  593. GrandmasterMatch *grandmasterMatchDo
  594. GudongLog *gudongLogDo
  595. IdiomLog *idiomLogDo
  596. Idiommatch *idiommatchDo
  597. Lady38rank2 *lady38rank2Do
  598. LimitgiftLog *limitgiftLogDo
  599. LoginLog *loginLogDo
  600. Menu *menuDo
  601. NewConvLog *newConvLogDo
  602. OnlineDurationLog *onlineDurationLogDo
  603. OnlineNumsLog *onlineNumsLogDo
  604. Order *orderDo
  605. OrdersRegStat *ordersRegStatDo
  606. OrdersSettle *ordersSettleDo
  607. OrdersSync *ordersSyncDo
  608. PayOrderAndriod *payOrderAndriodDo
  609. PayOrderIos *payOrderIosDo
  610. PlayerAttr *playerAttrDo
  611. PlayerBanLog *playerBanLogDo
  612. PlayerBattleDp *playerBattleDpDo
  613. PlayerCache *playerCacheDo
  614. PlayerChannel *playerChannelDo
  615. PlayerDayTask *playerDayTaskDo
  616. PlayerDivination *playerDivinationDo
  617. PlayerDp *playerDpDo
  618. PlayerLetter *playerLetterDo
  619. PlayerLogin *playerLoginDo
  620. PlayerMailbox *playerMailboxDo
  621. PlayerMaterial *playerMaterialDo
  622. PlayerPatrol *playerPatrolDo
  623. PlayerTask *playerTaskDo
  624. Processaward *processawardDo
  625. RedeemCode *redeemCodeDo
  626. RedeemPeripheralsReceived *redeemPeripheralsReceivedDo
  627. RedeemReceived *redeemReceivedDo
  628. ReportDayAdvBasic *reportDayAdvBasicDo
  629. ReportDayAdvSumm *reportDayAdvSummDo
  630. ReportDayBasic *reportDayBasicDo
  631. ReportDayBoss *reportDayBossDo
  632. ReportDayChapterPass *reportDayChapterPassDo
  633. ReportDayDisconnect *reportDayDisconnectDo
  634. ReportDayDuel *reportDayDuelDo
  635. ReportDayEventBasic *reportDayEventBasicDo
  636. ReportDayExpedition *reportDayExpeditionDo
  637. ReportDayFirstAdv *reportDayFirstAdvDo
  638. ReportDayGem *reportDayGemDo
  639. ReportDayGoodsBasic *reportDayGoodsBasicDo
  640. ReportDayGrandmaster *reportDayGrandmasterDo
  641. ReportDayGudong *reportDayGudongDo
  642. ReportDayHaveRole *reportDayHaveRoleDo
  643. ReportDayIdiom *reportDayIdiomDo
  644. ReportDayLimitgift *reportDayLimitgiftDo
  645. ReportDayNewConv *reportDayNewConvDo
  646. ReportDaySeven *reportDaySevenDo
  647. ReportDayTreasure *reportDayTreasureDo
  648. ReportDayTreasureChest *reportDayTreasureChestDo
  649. ReportEvent *reportEventDo
  650. ReportLevelOutput *reportLevelOutputDo
  651. Retrofit *retrofitDo
  652. RetrofitGroup *retrofitGroupDo
  653. Role *roleDo
  654. RolesLog *rolesLogDo
  655. ServerDeploy *serverDeployDo
  656. ServerDeployLog *serverDeployLogDo
  657. ServerDeployStat *serverDeployStatDo
  658. ServerOption *serverOptionDo
  659. SevenLog *sevenLogDo
  660. Signin *signinDo
  661. ToolsRestartLog *toolsRestartLogDo
  662. TreasureChestLog *treasureChestLogDo
  663. TreasureLog *treasureLogDo
  664. UserAccount *userAccountDo
  665. UserChapterLog *userChapterLogDo
  666. WxpayOrder *wxpayOrderDo
  667. WxpayPlayer *wxpayPlayerDo
  668. ZoneActivity *zoneActivityDo
  669. Chat *chatDo
  670. AdminBanUserLog *adminBanUserLogDo
  671. ChatReportLog *chatReportLogDo
  672. ChatMsgLog *chatMsgLogDo
  673. }
  674. func (q *Query) WithContext(ctx context.Context) *queryCtx {
  675. return &queryCtx{
  676. AdminMenu: q.AdminMenu.WithContext(ctx),
  677. AdminRoleMenu: q.AdminRoleMenu.WithContext(ctx),
  678. AdminRolePermission: q.AdminRolePermission.WithContext(ctx),
  679. AdminPermission: q.AdminPermission.WithContext(ctx),
  680. AdminOperation: q.AdminOperation.WithContext(ctx),
  681. AdminSystem: q.AdminSystem.WithContext(ctx),
  682. AdminEmail: q.AdminEmail.WithContext(ctx),
  683. AdminLog: q.AdminLog.WithContext(ctx),
  684. AdminNotice: q.AdminNotice.WithContext(ctx),
  685. AdminRole: q.AdminRole.WithContext(ctx),
  686. AdminUser: q.AdminUser.WithContext(ctx),
  687. AdvOriginLog: q.AdvOriginLog.WithContext(ctx),
  688. AdvertisementLog: q.AdvertisementLog.WithContext(ctx),
  689. AdvertisementSpace: q.AdvertisementSpace.WithContext(ctx),
  690. BossLog: q.BossLog.WithContext(ctx),
  691. Bosswar: q.Bosswar.WithContext(ctx),
  692. BuyStamina: q.BuyStamina.WithContext(ctx),
  693. Cache: q.Cache.WithContext(ctx),
  694. ChangedLog: q.ChangedLog.WithContext(ctx),
  695. ChangedPlayer: q.ChangedPlayer.WithContext(ctx),
  696. ChangedStatistic: q.ChangedStatistic.WithContext(ctx),
  697. ChangedSync: q.ChangedSync.WithContext(ctx),
  698. Channel: q.Channel.WithContext(ctx),
  699. Chapter: q.Chapter.WithContext(ctx),
  700. ChapterLog: q.ChapterLog.WithContext(ctx),
  701. ChapterLogsUserDetail: q.ChapterLogsUserDetail.WithContext(ctx),
  702. ChapterSync: q.ChapterSync.WithContext(ctx),
  703. ClientDatum: q.ClientDatum.WithContext(ctx),
  704. Climbfloor: q.Climbfloor.WithContext(ctx),
  705. Config: q.Config.WithContext(ctx),
  706. Curiomake: q.Curiomake.WithContext(ctx),
  707. CustomerServiceChatLog: q.CustomerServiceChatLog.WithContext(ctx),
  708. DisconnectLog: q.DisconnectLog.WithContext(ctx),
  709. DuelLog: q.DuelLog.WithContext(ctx),
  710. EventConfig: q.EventConfig.WithContext(ctx),
  711. ExpeditionLog: q.ExpeditionLog.WithContext(ctx),
  712. FirstAdvLog: q.FirstAdvLog.WithContext(ctx),
  713. GameAlarmCombatLog: q.GameAlarmCombatLog.WithContext(ctx),
  714. GameCharacterDataAnomaly: q.GameCharacterDataAnomaly.WithContext(ctx),
  715. GameDataAlarm: q.GameDataAlarm.WithContext(ctx),
  716. GemLog: q.GemLog.WithContext(ctx),
  717. GemPlayer: q.GemPlayer.WithContext(ctx),
  718. GemStat: q.GemStat.WithContext(ctx),
  719. Globalletter: q.Globalletter.WithContext(ctx),
  720. GoodsLog: q.GoodsLog.WithContext(ctx),
  721. Grandmaster: q.Grandmaster.WithContext(ctx),
  722. GrandmasterLog: q.GrandmasterLog.WithContext(ctx),
  723. GrandmasterMatch: q.GrandmasterMatch.WithContext(ctx),
  724. GudongLog: q.GudongLog.WithContext(ctx),
  725. IdiomLog: q.IdiomLog.WithContext(ctx),
  726. Idiommatch: q.Idiommatch.WithContext(ctx),
  727. Lady38rank2: q.Lady38rank2.WithContext(ctx),
  728. LimitgiftLog: q.LimitgiftLog.WithContext(ctx),
  729. LoginLog: q.LoginLog.WithContext(ctx),
  730. Menu: q.Menu.WithContext(ctx),
  731. NewConvLog: q.NewConvLog.WithContext(ctx),
  732. OnlineDurationLog: q.OnlineDurationLog.WithContext(ctx),
  733. OnlineNumsLog: q.OnlineNumsLog.WithContext(ctx),
  734. Order: q.Order.WithContext(ctx),
  735. OrdersRegStat: q.OrdersRegStat.WithContext(ctx),
  736. OrdersSettle: q.OrdersSettle.WithContext(ctx),
  737. OrdersSync: q.OrdersSync.WithContext(ctx),
  738. PayOrderAndriod: q.PayOrderAndriod.WithContext(ctx),
  739. PayOrderIos: q.PayOrderIos.WithContext(ctx),
  740. PlayerAttr: q.PlayerAttr.WithContext(ctx),
  741. PlayerBanLog: q.PlayerBanLog.WithContext(ctx),
  742. PlayerBattleDp: q.PlayerBattleDp.WithContext(ctx),
  743. PlayerCache: q.PlayerCache.WithContext(ctx),
  744. PlayerChannel: q.PlayerChannel.WithContext(ctx),
  745. PlayerDayTask: q.PlayerDayTask.WithContext(ctx),
  746. PlayerDivination: q.PlayerDivination.WithContext(ctx),
  747. PlayerDp: q.PlayerDp.WithContext(ctx),
  748. PlayerLetter: q.PlayerLetter.WithContext(ctx),
  749. PlayerLogin: q.PlayerLogin.WithContext(ctx),
  750. PlayerMailbox: q.PlayerMailbox.WithContext(ctx),
  751. PlayerMaterial: q.PlayerMaterial.WithContext(ctx),
  752. PlayerPatrol: q.PlayerPatrol.WithContext(ctx),
  753. PlayerTask: q.PlayerTask.WithContext(ctx),
  754. Processaward: q.Processaward.WithContext(ctx),
  755. RedeemCode: q.RedeemCode.WithContext(ctx),
  756. RedeemPeripheralsReceived: q.RedeemPeripheralsReceived.WithContext(ctx),
  757. RedeemReceived: q.RedeemReceived.WithContext(ctx),
  758. ReportDayAdvBasic: q.ReportDayAdvBasic.WithContext(ctx),
  759. ReportDayAdvSumm: q.ReportDayAdvSumm.WithContext(ctx),
  760. ReportDayBasic: q.ReportDayBasic.WithContext(ctx),
  761. ReportDayBoss: q.ReportDayBoss.WithContext(ctx),
  762. ReportDayChapterPass: q.ReportDayChapterPass.WithContext(ctx),
  763. ReportDayDisconnect: q.ReportDayDisconnect.WithContext(ctx),
  764. ReportDayDuel: q.ReportDayDuel.WithContext(ctx),
  765. ReportDayEventBasic: q.ReportDayEventBasic.WithContext(ctx),
  766. ReportDayExpedition: q.ReportDayExpedition.WithContext(ctx),
  767. ReportDayFirstAdv: q.ReportDayFirstAdv.WithContext(ctx),
  768. ReportDayGem: q.ReportDayGem.WithContext(ctx),
  769. ReportDayGoodsBasic: q.ReportDayGoodsBasic.WithContext(ctx),
  770. ReportDayGrandmaster: q.ReportDayGrandmaster.WithContext(ctx),
  771. ReportDayGudong: q.ReportDayGudong.WithContext(ctx),
  772. ReportDayHaveRole: q.ReportDayHaveRole.WithContext(ctx),
  773. ReportDayIdiom: q.ReportDayIdiom.WithContext(ctx),
  774. ReportDayLimitgift: q.ReportDayLimitgift.WithContext(ctx),
  775. ReportDayNewConv: q.ReportDayNewConv.WithContext(ctx),
  776. ReportDaySeven: q.ReportDaySeven.WithContext(ctx),
  777. ReportDayTreasure: q.ReportDayTreasure.WithContext(ctx),
  778. ReportDayTreasureChest: q.ReportDayTreasureChest.WithContext(ctx),
  779. ReportEvent: q.ReportEvent.WithContext(ctx),
  780. ReportLevelOutput: q.ReportLevelOutput.WithContext(ctx),
  781. Retrofit: q.Retrofit.WithContext(ctx),
  782. RetrofitGroup: q.RetrofitGroup.WithContext(ctx),
  783. Role: q.Role.WithContext(ctx),
  784. RolesLog: q.RolesLog.WithContext(ctx),
  785. ServerDeploy: q.ServerDeploy.WithContext(ctx),
  786. ServerDeployLog: q.ServerDeployLog.WithContext(ctx),
  787. ServerDeployStat: q.ServerDeployStat.WithContext(ctx),
  788. ServerOption: q.ServerOption.WithContext(ctx),
  789. SevenLog: q.SevenLog.WithContext(ctx),
  790. Signin: q.Signin.WithContext(ctx),
  791. ToolsRestartLog: q.ToolsRestartLog.WithContext(ctx),
  792. TreasureChestLog: q.TreasureChestLog.WithContext(ctx),
  793. TreasureLog: q.TreasureLog.WithContext(ctx),
  794. UserAccount: q.UserAccount.WithContext(ctx),
  795. UserChapterLog: q.UserChapterLog.WithContext(ctx),
  796. WxpayOrder: q.WxpayOrder.WithContext(ctx),
  797. WxpayPlayer: q.WxpayPlayer.WithContext(ctx),
  798. ZoneActivity: q.ZoneActivity.WithContext(ctx),
  799. Chat: q.Chat.WithContext(ctx),
  800. AdminBanUserLog: q.AdminBanUserLog.WithContext(ctx),
  801. ChatReportLog: q.ChatReportLog.WithContext(ctx),
  802. ChatMsgLog: q.ChatMsgLog.WithContext(ctx),
  803. }
  804. }
  805. func (q *Query) Transaction(fc func(tx *Query) error, opts ...*sql.TxOptions) error {
  806. return q.db.Transaction(func(tx *gorm.DB) error { return fc(q.clone(tx)) }, opts...)
  807. }
  808. func (q *Query) Begin(opts ...*sql.TxOptions) *QueryTx {
  809. return &QueryTx{q.clone(q.db.Begin(opts...))}
  810. }
  811. type QueryTx struct{ *Query }
  812. func (q *QueryTx) Commit() error {
  813. return q.db.Commit().Error
  814. }
  815. func (q *QueryTx) Rollback() error {
  816. return q.db.Rollback().Error
  817. }
  818. func (q *QueryTx) SavePoint(name string) error {
  819. return q.db.SavePoint(name).Error
  820. }
  821. func (q *QueryTx) RollbackTo(name string) error {
  822. return q.db.RollbackTo(name).Error
  823. }