蛋蛋星球-制度模式
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

506 lines
18 KiB

  1. package egg_energy
  2. import (
  3. "code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
  4. "code.fnuoos.com/EggPlanet/egg_models.git/src/model"
  5. "code.fnuoos.com/EggPlanet/egg_system_rules.git/enum"
  6. "code.fnuoos.com/EggPlanet/egg_system_rules.git/md"
  7. "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule"
  8. md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md"
  9. "code.fnuoos.com/EggPlanet/egg_system_rules.git/svc/sys_cfg"
  10. egg_system_rules "code.fnuoos.com/EggPlanet/egg_system_rules.git/utils"
  11. "code.fnuoos.com/EggPlanet/egg_system_rules.git/utils/cache"
  12. "code.fnuoos.com/EggPlanet/egg_system_rules.git/utils/es"
  13. zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_system_rules.git/utils/logx"
  14. es2 "code.fnuoos.com/go_rely_warehouse/zyos_go_es.git/es"
  15. "code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit"
  16. "encoding/json"
  17. "errors"
  18. "fmt"
  19. "github.com/olivere/elastic/v7"
  20. "github.com/shopspring/decimal"
  21. "strings"
  22. "time"
  23. "xorm.io/xorm"
  24. )
  25. // SettlementGiveActivityCoin 结算观看激励广告得到蛋蛋积分
  26. func SettlementGiveActivityCoin(engine *xorm.Engine, user model.User, ecpm string, ch *rabbit.Channel) (rewardValue float64, err error) {
  27. egg_system_rules.FilePutContents("SettlementGiveActivityCoin", egg_system_rules.SerializeStr(user))
  28. uid := user.Id
  29. now := time.Now()
  30. //TODO::拒绝重复异常回调
  31. redisKey := fmt.Sprintf(md2.UserNextWatchAdDate, uid)
  32. nextWatchAdDate, _ := cache.GetString(redisKey)
  33. if nextWatchAdDate != "" {
  34. nextWatchAdDateValue := egg_system_rules.String2Time(nextWatchAdDate)
  35. if nextWatchAdDateValue.After(time.Now()) {
  36. return 0, errors.New("未到可观看时间~~")
  37. }
  38. }
  39. //1、查找 `egg_energy_basic_setting` 基础设置
  40. eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(engine)
  41. eggEnergyBasicSetting, err := eggEnergyBasicSettingDb.EggEnergyBasicSettingGetOneByParams(map[string]interface{}{
  42. "key": "is_open",
  43. "value": 1,
  44. })
  45. if err != nil {
  46. return
  47. }
  48. if eggEnergyBasicSetting == nil {
  49. err = errors.New("蛋蛋能量设置未开启!")
  50. return
  51. }
  52. var videoRewardSystem *md2.VideoRewardSystemStruct
  53. err = json.Unmarshal([]byte(eggEnergyBasicSetting.VideoRewardSystem), &videoRewardSystem)
  54. if err != nil {
  55. return
  56. }
  57. if eggEnergyBasicSetting.VideoRewardIsOpen == 1 {
  58. if videoRewardSystem.RewardTotalNum == "" || videoRewardSystem.IntervalMinutes == "" || videoRewardSystem.EachRoundHour == "" {
  59. err = errors.New("视屏奖励机制设置未完全!")
  60. return
  61. }
  62. var rewardSystem []*md2.RewardSystemStruct
  63. err = json.Unmarshal([]byte(eggEnergyBasicSetting.RewardSystem), &rewardSystem)
  64. if err != nil {
  65. return
  66. }
  67. if len(rewardSystem) == 0 {
  68. err = errors.New("未设置奖励机制!")
  69. return
  70. }
  71. go dealEcpm(user, ecpm, ch) //TODO::协程处理ecpm的变化
  72. //TODO::奖励多少个活跃积分(根据ecpm, 新用户机制, 蛋蛋分机制)
  73. sysCfgDb := sys_cfg.NewSysCfgDb(engine)
  74. videoRewardUnitPrice := sysCfgDb.SysCfgGetWithDb(enum.VideoRewardUnitPrice)
  75. if videoRewardUnitPrice != "" { //处理ecpm
  76. var coin model.VirtualCoin
  77. _, err = engine.Where("id = ?", eggEnergyBasicSetting.PersonEggPointsCoinId).Get(&coin)
  78. if err != nil {
  79. return rewardValue, err
  80. }
  81. activePointsCoinExchangeRatioValue, _ := decimal.NewFromString(coin.ExchangeRatio)
  82. videoRewardUnitPriceValue, _ := decimal.NewFromString(videoRewardUnitPrice)
  83. rewardValue, _ = videoRewardUnitPriceValue.Mul(activePointsCoinExchangeRatioValue).Float64()
  84. } else {
  85. rewardValue = egg_system_rules.StrToFloat64(videoRewardSystem.RewardValue)
  86. }
  87. var newUserRewardRules *md2.NewUserRewardRules
  88. err = json.Unmarshal([]byte(eggEnergyBasicSetting.NewUserIncentiveRules), &newUserRewardRules)
  89. if err != nil {
  90. return
  91. }
  92. userCreateAt := egg_system_rules.String2Time(user.CreateAt)
  93. if int(now.Sub(userCreateAt).Hours()/24) <= newUserRewardRules.ContinueDays { //处理新用户机制
  94. rewardValue *= newUserRewardRules.RewardCoefficient
  95. }
  96. score := 60.00
  97. esIndex := es.GetLatestEffectiveIndexFromAlias(now)
  98. esIndexName := md.EggEnergyUserEggScoreEsAlias + "_" + esIndex
  99. results, err1 := es2.FirstDoc(esIndexName, esIndex+"_"+egg_system_rules.Int64ToStr(user.Id))
  100. if err1 != nil {
  101. if !elastic.IsNotFound(err1) {
  102. return rewardValue, err1
  103. }
  104. }
  105. if !elastic.IsNotFound(err1) {
  106. var doc md.EggEnergyUserEggScoreEs
  107. err = json.Unmarshal(results.Source, &doc)
  108. if err != nil {
  109. return
  110. }
  111. score = doc.ScoreValue
  112. }
  113. eggPointPartitionCoefficientManagementDb := implement.NewEggPointPartitionCoefficientManagementDb(engine)
  114. eggPointPartitionCoefficientManagements, err1 := eggPointPartitionCoefficientManagementDb.EggPointPartitionCoefficientManagementGetAll()
  115. if err1 != nil {
  116. return rewardValue, err1
  117. }
  118. for _, v := range *eggPointPartitionCoefficientManagements { //处理蛋蛋分机制
  119. if egg_system_rules.StrToFloat64(v.StartScore) <= score && egg_system_rules.StrToFloat64(v.EndScore) > score {
  120. rewardValue *= egg_system_rules.StrToFloat64(v.Coefficient)
  121. }
  122. }
  123. //处理圈层奖励
  124. var rewardSystemMap = map[int]*md2.RewardSystemStruct{}
  125. for _, v := range rewardSystem {
  126. rewardSystemMap[v.Level] = v
  127. }
  128. publicPlatoonUserRelationDb := implement.NewPublicPlatoonUserRelationDb(engine)
  129. publicPlatoonUserRelation, err1 := publicPlatoonUserRelationDb.PublicPlatoonUserRelationGetOneByParams(map[string]interface{}{
  130. "key": "uid",
  131. "value": uid,
  132. })
  133. if err1 != nil {
  134. return rewardValue, err1
  135. }
  136. var rewardFather []struct {
  137. Uid int64 `json:"uid"` //用户id
  138. RewardValue float64 `json:"reward_value"` //奖励值
  139. StartAt string `json:"start_at"`
  140. EndAt string `json:"end_at"`
  141. SignId int64 `json:"sign_id"`
  142. }
  143. var fatherUids []string
  144. if publicPlatoonUserRelation != nil {
  145. fatherUids = strings.Split(publicPlatoonUserRelation.FatherUid, "-")
  146. }
  147. for k, id := range fatherUids {
  148. tmpOneCirclesPublicPlatoonUserRelation, err11 := publicPlatoonUserRelationDb.PublicPlatoonUserRelationGetOneByParams(map[string]interface{}{
  149. "key": "id",
  150. "value": id,
  151. })
  152. if err11 != nil {
  153. return rewardValue, err11
  154. }
  155. if tmpOneCirclesPublicPlatoonUserRelation == nil {
  156. continue
  157. }
  158. if tmpOneCirclesPublicPlatoonUserRelation.Uid <= 0 {
  159. //待填充位
  160. continue
  161. }
  162. fatherUid := egg_system_rules.Int64ToStr(tmpOneCirclesPublicPlatoonUserRelation.Uid)
  163. fatherReward := rewardSystemMap[k+1]
  164. //TODO::判断是否活跃
  165. var m model.EggSignIn
  166. has, err33 := engine.Where("uid =?", fatherUid).And("end_time >=?", time.Now().Format("2006-01-02 15:04:05")).Get(&m)
  167. if err33 != nil {
  168. return rewardValue, err33
  169. }
  170. if !has {
  171. //不活跃不需要奖励
  172. continue
  173. }
  174. //判断是否满足奖励条件
  175. userRelateDb := implement.NewUserRelateDb(engine)
  176. userCount, _, err2 := userRelateDb.SumUserRelateByParentUid(fatherUid)
  177. if err2 != nil {
  178. return rewardValue, err2
  179. }
  180. if fatherReward != nil && userCount >= egg_system_rules.StrToInt64(fatherReward.RewardCondition) {
  181. fatherRewardValue := rewardValue * (egg_system_rules.StrToFloat64(fatherReward.RewardValue) / 100)
  182. rewardFather = append(rewardFather, struct {
  183. Uid int64 `json:"uid"` //用户id
  184. RewardValue float64 `json:"reward_value"` //奖励值
  185. StartAt string `json:"start_at"`
  186. EndAt string `json:"end_at"`
  187. SignId int64 `json:"sign_id"`
  188. }{
  189. Uid: egg_system_rules.StrToInt64(fatherUid),
  190. RewardValue: fatherRewardValue,
  191. StartAt: m.StartTime,
  192. EndAt: m.EndTime,
  193. SignId: m.Id,
  194. })
  195. }
  196. }
  197. //处理直推奖励
  198. var directPushRewardSetting *md2.DirectPushRewardSettingStruct
  199. err = json.Unmarshal([]byte(eggEnergyBasicSetting.DirectPushReward), &directPushRewardSetting)
  200. if err != nil {
  201. return
  202. }
  203. fatherRewardValue := rewardValue * (egg_system_rules.StrToFloat64(directPushRewardSetting.RewardRateValue) / 100)
  204. var fatherSign model.EggSignIn
  205. if directPushRewardSetting.MemberSelfIsOpenGetTeamReward == "1" {
  206. fmt.Println("user:::::::::::::", user)
  207. has, err44 := engine.Where("uid =?", user.ParentUid).And("end_time >=?", time.Now().Format("2006-01-02 15:04:05")).Get(&fatherSign)
  208. if err44 != nil {
  209. return rewardValue, err44
  210. }
  211. if !has {
  212. //不活跃不需要奖励
  213. fatherRewardValue = 0
  214. }
  215. }
  216. session := engine.NewSession()
  217. defer func() {
  218. session.Close()
  219. if err := recover(); err != nil {
  220. _ = zhios_order_relate_logx.Error(err)
  221. }
  222. }()
  223. session.Begin()
  224. //给相应的用户加上"个人"活跃积分
  225. err = rule.DealUserVirtualCoin(session, md.DealUserVirtualCoinReq{
  226. Kind: "add",
  227. Title: enum.UserVirtualAmountFlowTransferType.String(enum.EggEnergyWatchAdRewardPersonalActiveCoin),
  228. TransferType: int(enum.EggEnergyWatchAdRewardPersonalActiveCoin),
  229. CoinId: eggEnergyBasicSetting.PersonEggPointsCoinId,
  230. Uid: uid,
  231. Amount: rewardValue,
  232. })
  233. if err != nil {
  234. _ = session.Rollback()
  235. fmt.Println("err:::::2222", err)
  236. return rewardValue, err
  237. }
  238. //给相应的用户上级加上"团队"活跃积分
  239. if fatherRewardValue > 0 {
  240. err = rule.DealUserVirtualCoin(session, md.DealUserVirtualCoinReq{
  241. Kind: "add",
  242. Title: enum.UserVirtualAmountFlowTransferType.String(enum.EggEnergyWatchAdRewardFansActiveCoin),
  243. TransferType: int(enum.EggEnergyWatchAdRewardFansActiveCoin),
  244. CoinId: eggEnergyBasicSetting.TeamEggPointsCoinId,
  245. Uid: user.ParentUid,
  246. Amount: fatherRewardValue,
  247. })
  248. if err != nil {
  249. _ = session.Rollback()
  250. fmt.Println("err:::::2222", err)
  251. return rewardValue, err
  252. }
  253. }
  254. //给相应的用户加上"团队"活跃积分
  255. for _, vv := range rewardFather {
  256. if vv.RewardValue > 0 {
  257. //TODO::推入rabbitmq 异步处理
  258. ch.Publish(md2.EggEnergyExchange, md.DealUserVirtualCoinReq{
  259. Kind: "add",
  260. Title: enum.UserVirtualAmountFlowTransferType.String(enum.EggEnergyWatchAdRewardTeamActiveCoin),
  261. TransferType: int(enum.EggEnergyWatchAdRewardTeamActiveCoin),
  262. CoinId: eggEnergyBasicSetting.TeamEggPointsCoinId,
  263. Uid: vv.Uid,
  264. Amount: vv.RewardValue,
  265. }, md2.EggEnergyRoutKeyForSettlementPublicGiveActivityCoin)
  266. ch.Publish(md2.EggEnergyExchange, md2.EggEnergyTeamAssistanceReq{
  267. AssistanceUid: uid,
  268. Uid: vv.Uid,
  269. AssistanceValue: vv.RewardValue,
  270. SignStart: vv.StartAt,
  271. SignEnd: vv.EndAt,
  272. SignId: vv.SignId,
  273. }, md2.EggEnergyTeamAssistance)
  274. }
  275. }
  276. err = session.Commit()
  277. if err != nil {
  278. _ = session.Rollback()
  279. return rewardValue, errors.New("事务提交失败")
  280. }
  281. }
  282. //增加 egg_user_watch_records 记录
  283. eggEnergyUserWatchRecordsDb := implement.NewEggEnergyUserWatchRecordsDb(engine)
  284. eggEnergyUserWatchRecords, err1 := eggEnergyUserWatchRecordsDb.EggEnergyUserWatchRecordsGetOneByParams(map[string]interface{}{
  285. "key": "uid",
  286. "value": uid,
  287. })
  288. if err1 != nil {
  289. return rewardValue, err1
  290. }
  291. if eggEnergyUserWatchRecords == nil {
  292. residueWatchAdNum := egg_system_rules.StrToInt(videoRewardSystem.RewardTotalNum) - 1
  293. if residueWatchAdNum < 0 {
  294. residueWatchAdNum = egg_system_rules.StrToInt(videoRewardSystem.RewardTotalNum)
  295. }
  296. eggEnergyUserWatchRecords = &model.EggEnergyUserWatchRecords{
  297. Uid: uid,
  298. NextWatchAdDate: now.Add(time.Hour * time.Duration(egg_system_rules.StrToInt(videoRewardSystem.EachRoundHour))),
  299. ResidueWatchAdNum: egg_system_rules.StrToInt(videoRewardSystem.RewardTotalNum) - 1,
  300. CreateAt: now.Format("2006-01-02 15:04:05"),
  301. UpdateAt: now.Format("2006-01-02 15:04:05"),
  302. }
  303. _, err2 := eggEnergyUserWatchRecordsDb.EggEnergyUserWatchRecordsInsert(eggEnergyUserWatchRecords)
  304. if err2 != nil {
  305. return rewardValue, err2
  306. }
  307. } else {
  308. residueWatchAdNum := eggEnergyUserWatchRecords.ResidueWatchAdNum - 1
  309. nextWatchAdDate := eggEnergyUserWatchRecords.NextWatchAdDate
  310. if residueWatchAdNum == 0 { //最后一条广告
  311. residueWatchAdNum = egg_system_rules.StrToInt(videoRewardSystem.RewardTotalNum)
  312. }
  313. if residueWatchAdNum == egg_system_rules.StrToInt(videoRewardSystem.RewardTotalNum)-1 { //第一条广告
  314. nextWatchAdDate = now.Add(time.Hour * time.Duration(egg_system_rules.StrToInt(videoRewardSystem.EachRoundHour)))
  315. }
  316. eggEnergyUserWatchRecords.ResidueWatchAdNum = residueWatchAdNum
  317. eggEnergyUserWatchRecords.NextWatchAdDate = nextWatchAdDate
  318. _, err2 := eggEnergyUserWatchRecordsDb.EggEnergyUserWatchRecordsUpdate(eggEnergyUserWatchRecords.Id, eggEnergyUserWatchRecords, "residue_watch_ad_num", "next_watch_ad_date")
  319. if err2 != nil {
  320. return rewardValue, err2
  321. }
  322. }
  323. var watchAdDate string
  324. if eggEnergyUserWatchRecords.ResidueWatchAdNum == egg_system_rules.StrToInt(videoRewardSystem.RewardTotalNum) {
  325. if eggEnergyUserWatchRecords.NextWatchAdDate.Before(time.Now()) {
  326. watchAdDate = ""
  327. } else {
  328. watchAdDate = eggEnergyUserWatchRecords.NextWatchAdDate.Format("2006-01-02 15:04:05")
  329. }
  330. } else {
  331. watchAdDate = time.Now().Add(time.Duration(egg_system_rules.StrToInt64(videoRewardSystem.IntervalMinutes)) * time.Second).Format("2006-01-02 15:04:05")
  332. }
  333. cache.SetEx(redisKey, watchAdDate, 60*60*24) //TODO::默认缓存1小时
  334. return
  335. }
  336. func dealEcpm(user model.User, ecpm string, ch *rabbit.Channel) {
  337. //查找缓存中的ecpm值和当前的ecpm是否一致
  338. key := fmt.Sprintf(md.UserEcpmCacheKey, user.Id)
  339. ecpmCacheValue, _ := cache.GetString(key)
  340. if ecpmCacheValue == "" || ecpmCacheValue != ecpm {
  341. //更新缓存值
  342. cache.SetEx(key, ecpm, md.UserEcpmCacheTime)
  343. //TODO::推入rabbitmq 异步处理
  344. ch.Publish(md2.EggEnergyExchange, md.DealUserEcpmReq{
  345. Uid: user.Id,
  346. Ecpm: ecpm,
  347. }, md2.EggEnergyRoutKeyForDealUserEcpm)
  348. }
  349. }
  350. func ActivityCoinToAlipayRealName(engine *xorm.Engine, uid int64, amount string) (err error) {
  351. amountValue, _ := decimal.NewFromString(amount)
  352. //1、查找 `egg_energy_basic_setting` 基础设置
  353. eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(engine)
  354. eggEnergyBasicSetting, err := eggEnergyBasicSettingDb.EggEnergyBasicSettingGetOneByParams(map[string]interface{}{
  355. "key": "is_open",
  356. "value": 1,
  357. })
  358. if err != nil {
  359. return
  360. }
  361. if eggEnergyBasicSetting == nil {
  362. err = errors.New("蛋蛋能量设置未开启!")
  363. return
  364. }
  365. var coin model.VirtualCoin
  366. _, err = engine.Where("id = ?", eggEnergyBasicSetting.PersonEggPointsCoinId).Get(&coin)
  367. if err != nil {
  368. return
  369. }
  370. personActivePointsCoinExchangeRatioValue, _ := decimal.NewFromString(coin.ExchangeRatio)
  371. //2、判断个人蛋蛋积分是否足够
  372. var personUserVirtualAmount model.UserVirtualAmount
  373. _, err = engine.Where("coin_id = ?", eggEnergyBasicSetting.PersonEggPointsCoinId).And("uid =?", uid).Get(&personUserVirtualAmount)
  374. if err != nil {
  375. fmt.Println("err:::::1111", err)
  376. return
  377. }
  378. personUserVirtualAmountValue, _ := decimal.NewFromString(personUserVirtualAmount.Amount)
  379. needVirtualAmountValue := amountValue.Mul(personActivePointsCoinExchangeRatioValue)
  380. needVirtualAmount, _ := amountValue.Mul(personActivePointsCoinExchangeRatioValue).Float64()
  381. if personUserVirtualAmountValue.LessThan(needVirtualAmountValue) {
  382. err = errors.New("当前蛋蛋积分不足!")
  383. return
  384. }
  385. //3、扣除对应个人蛋蛋积分
  386. session := engine.NewSession()
  387. defer func() {
  388. session.Close()
  389. if err := recover(); err != nil {
  390. _ = zhios_order_relate_logx.Error(err)
  391. }
  392. }()
  393. session.Begin()
  394. //给相应的用户加上"个人"活跃积分
  395. err = rule.DealUserVirtualCoin(session, md.DealUserVirtualCoinReq{
  396. Kind: "sub",
  397. Title: enum.UserVirtualAmountFlowTransferType.String(enum.EggPointCoinToAliPayRealName),
  398. TransferType: int(enum.EggPointCoinToAliPayRealName),
  399. CoinId: eggEnergyBasicSetting.PersonEggPointsCoinId,
  400. Uid: uid,
  401. Amount: needVirtualAmount,
  402. })
  403. if err != nil {
  404. _ = session.Rollback()
  405. fmt.Println("err:::::2222", err)
  406. return err
  407. }
  408. err = session.Commit()
  409. if err != nil {
  410. _ = session.Rollback()
  411. return errors.New("事务提交失败")
  412. }
  413. return
  414. }
  415. func CheckActivityCoinToAlipayRealName(engine *xorm.Engine, uid int64, amount string) (err error, isCan bool) {
  416. amountValue, _ := decimal.NewFromString(amount)
  417. //1、查找 `egg_energy_basic_setting` 基础设置
  418. eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(engine)
  419. eggEnergyBasicSetting, err := eggEnergyBasicSettingDb.EggEnergyBasicSettingGetOneByParams(map[string]interface{}{
  420. "key": "is_open",
  421. "value": 1,
  422. })
  423. if err != nil {
  424. return
  425. }
  426. if eggEnergyBasicSetting == nil {
  427. err = errors.New("蛋蛋能量设置未开启!")
  428. return
  429. }
  430. var coin model.VirtualCoin
  431. _, err = engine.Where("id = ?", eggEnergyBasicSetting.PersonEggPointsCoinId).Get(&coin)
  432. if err != nil {
  433. return
  434. }
  435. personActivePointsCoinExchangeRatioValue, _ := decimal.NewFromString(coin.ExchangeRatio)
  436. //2、判断个人蛋蛋积分是否足够
  437. var personUserVirtualAmount model.UserVirtualAmount
  438. _, err = engine.Where("coin_id = ?", eggEnergyBasicSetting.PersonEggPointsCoinId).And("uid =?", uid).Get(&personUserVirtualAmount)
  439. if err != nil {
  440. fmt.Println("err:::::1111", err)
  441. return
  442. }
  443. personUserVirtualAmountValue, _ := decimal.NewFromString(personUserVirtualAmount.Amount)
  444. needVirtualAmountValue := amountValue.Mul(personActivePointsCoinExchangeRatioValue)
  445. if personUserVirtualAmountValue.GreaterThan(needVirtualAmountValue) {
  446. isCan = true
  447. }
  448. return
  449. }
  450. // CalcUserContinuousDailyActivityDays 计算用户连续活跃天数
  451. func CalcUserContinuousDailyActivityDays(engine *xorm.Engine, uid int, startDate string, endDate string) (err error, days int, isContinuousDailyActivity bool) {
  452. startAt, err := time.ParseInLocation("2006-01-02", startDate, time.Local) //起始时间
  453. endAt, err := time.ParseInLocation("2006-01-02", endDate, time.Local) //起始时间
  454. var list []model.EggEnergyUserActivity
  455. err = engine.Where("date >= ?", startAt.Format("2006-01-02")).
  456. And("date < ?", endAt.Format("2006-01-02")).
  457. And("uid =?", uid).Find(&list)
  458. if err != nil {
  459. fmt.Println("err:::::1111", err)
  460. return
  461. }
  462. days = len(list)
  463. diffDays := egg_system_rules.GetDiffDays(endAt, startAt) //相差天数
  464. if days == diffDays {
  465. isContinuousDailyActivity = true
  466. }
  467. return
  468. }