예제 #1
0
        public bool LotteryAnalyzeYesterday(MsgInformationEx MsgDTO, object[] param)
        {
            var yesterdayRec = LotteryRecord.GetYesterday();

            MsgSender.PushMsg(MsgDTO, yesterdayRec.ToString());

            return(true);
        }
예제 #2
0
        public static LotteryRecord GetYesterday()
        {
            var dateStr = DateTime.Now.AddDays(-1).ToString("yyyyMMdd");
            var record  = MongoService <LotteryRecord> .GetOnly(p => p.DataStr == dateStr);

            if (record != null)
            {
                return(record);
            }

            record = new LotteryRecord()
            {
                DataStr = dateStr
            };

            MongoService <LotteryRecord> .Insert(record);

            return(record);
        }
예제 #3
0
        private void RandomLottery(MsgInformationEx MsgDTO)
        {
            var lottery = LotterySvc.RandLottery();

            var absBonus = lottery.Bonus - LotterySvc.LotteryFee;

            LotteryRecord.Record(absBonus);

            var personRec = LotteryPersonRecord.Get(MsgDTO.FromQQ);

            personRec.AddLottery(lottery.Name);
            personRec.Update();

            var msg = lottery.ToString();

            var golds = OSPerson.GoldConsume(MsgDTO.FromQQ, LotterySvc.LotteryFee - lottery.Bonus);

            msg += $"\r\n你当前持有金币:{golds.CurencyFormat()}";
            MsgSender.PushMsg(MsgDTO, msg, true);
        }