Преглед изворни кода

盒易付非首台,刷满1000得50

lichunlei пре 1 година
родитељ
комит
c9f7500aaf
1 измењених фајлова са 33 додато и 35 уклоњено
  1. 33 35
      AppStart/Helper/StatService.cs

+ 33 - 35
AppStart/Helper/StatService.cs

@@ -397,46 +397,44 @@ namespace MySystem
                         {
                             TopUserId = int.Parse(ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
                         }
-                        if(pos.CreditTrade >= 5000) //首台无押金机返50
+                        //首台无押金机返50
+                        if(pos.IsFirst == 1 && pos.CreditTrade >= 5000)
                         {
-                            if(pos.IsFirst == 1)
-                            {
-                                doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
-                            }
-                            else
+                            doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
+                        }
+                        if(pos.IsFirst == 0 && pos.CreditTrade >= 1000)
+                        {
+                            string IdCard = merchant.MerIdcardNo;
+                            string IdCardStart = IdCard.Substring(0, 6);
+                            string IdCardEnd = IdCard.Substring(IdCard.Length - 4);
+                            string MerName = merchant.MerchantName;
+                            List<int> BrandIds = new List<int>();
+                            BrandIds.Add(4);
+                            BrandIds.Add(5);
+                            BrandIds.Add(8);
+                            BrandIds.Add(9);
+                            PosMerchantInfo other = db.PosMerchantInfo.FirstOrDefault(m => m.MerIdcardNo.StartsWith(IdCardStart) && m.MerIdcardNo.EndsWith(IdCardEnd) && m.MerchantName.Contains(MerName) && BrandIds.Contains(m.BrandId));
+                            if(other != null)
                             {
-                                string IdCard = merchant.MerIdcardNo;
-                                string IdCardStart = IdCard.Substring(0, 6);
-                                string IdCardEnd = IdCard.Substring(IdCard.Length - 4);
-                                string MerName = merchant.MerchantName;
-                                List<int> BrandIds = new List<int>();
-                                BrandIds.Add(4);
-                                BrandIds.Add(5);
-                                BrandIds.Add(8);
-                                BrandIds.Add(9);
-                                PosMerchantInfo other = db.PosMerchantInfo.FirstOrDefault(m => m.MerIdcardNo.StartsWith(IdCardStart) && m.MerIdcardNo.EndsWith(IdCardEnd) && m.MerchantName.Contains(MerName) && BrandIds.Contains(m.BrandId));
-                                if(other != null)
+                                PosMachinesTwo checkpos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == other.KqSnNo && m.IsFirst == 1);
+                                if(checkpos != null)
                                 {
-                                    PosMachinesTwo checkpos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == other.KqSnNo && m.IsFirst == 1);
-                                    if(checkpos != null)
+                                    doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
+                                    PosMachinesTwo edit = db.PosMachinesTwo.FirstOrDefault(m => m.Id == pos.Id);
+                                    if(edit != null)
                                     {
-                                        doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
-                                        PosMachinesTwo edit = db.PosMachinesTwo.FirstOrDefault(m => m.Id == pos.Id);
-                                        if(edit != null)
+                                        edit.SeoKeyword = checkpos.SeoKeyword;
+                                        edit.UpFeeFlag = checkpos.UpFeeFlag;
+                                        edit.DownFeeFlag = checkpos.DownFeeFlag;
+                                        edit.UpFeeDate = checkpos.UpFeeDate;
+                                        edit.DownFeeDate = checkpos.DownFeeDate;
+                                        edit.BindingTime = checkpos.BindingTime;
+                                        edit.IsFirst = checkpos.IsFirst;
+                                        db.SaveChanges();
+                                        if(edit.UpFeeFlag == 1 && edit.DownFeeFlag == 0)
                                         {
-                                            edit.SeoKeyword = checkpos.SeoKeyword;
-                                            edit.UpFeeFlag = checkpos.UpFeeFlag;
-                                            edit.DownFeeFlag = checkpos.DownFeeFlag;
-                                            edit.UpFeeDate = checkpos.UpFeeDate;
-                                            edit.DownFeeDate = checkpos.DownFeeDate;
-                                            edit.BindingTime = checkpos.BindingTime;
-                                            edit.IsFirst = checkpos.IsFirst;
-                                            db.SaveChanges();
-                                            if(edit.UpFeeFlag == 1 && edit.DownFeeFlag == 0)
-                                            {
-                                                string info = "{\"RecordId\":\"\",\"PosId\":\"" + edit.Id + "\",\"Fee\": \"0.63\",\"Kind\": \"1\",\"OpMan\": \"系统\"}";
-                                                RedisDbconn.Instance.AddList("SetDepositPostQueue", info);
-                                            }
+                                            string info = "{\"RecordId\":\"\",\"PosId\":\"" + edit.Id + "\",\"Fee\": \"0.63\",\"Kind\": \"1\",\"OpMan\": \"系统\"}";
+                                            RedisDbconn.Instance.AddList("SetDepositPostQueue", info);
                                         }
                                     }
                                 }