瀏覽代碼

每月重置分仓额度,减去仓库机额度

lichunlei 2 年之前
父節點
當前提交
d781af2062
共有 1 個文件被更改,包括 11 次插入10 次删除
  1. 11 10
      AppStart/Timer/StoreApplyHelper.cs

+ 11 - 10
AppStart/Timer/StoreApplyHelper.cs

@@ -86,20 +86,21 @@ public class StoreApplyHelper
                                 dataDic[store.UserId] += AmountMore;
                             }
                         }
+                        // TODO: 上个月申请了但未发货的额度,要减掉
                         foreach(int UserId in dataDic.Keys)
                         {
                             decimal Amount = dataDic[UserId];
                             decimal AmountMore = 0;
-                            // DataTable dtmore = OtherMySqlConn.dtable("select count(Id)*200 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (1,2,4,6,7,8) and `Status`>-1");
-                            // if(dtmore.Rows.Count > 0)
-                            // {
-                            //     AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
-                            // }
-                            // dtmore = OtherMySqlConn.dtable("select count(Id)*300 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (3,5,9) and `Status`>-1");
-                            // if(dtmore.Rows.Count > 0)
-                            // {
-                            //     AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
-                            // }
+                            DataTable dtmore = OtherMySqlConn.dtable("select count(Id)*200 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (1,2,4,6,7,8) and `Status`>-1");
+                            if(dtmore.Rows.Count > 0)
+                            {
+                                AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
+                            }
+                            dtmore = OtherMySqlConn.dtable("select count(Id)*300 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (3,5,9) and `Status`>-1");
+                            if(dtmore.Rows.Count > 0)
+                            {
+                                AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
+                            }
                             if(Amount < 10000 && SpecialUsers10000().Contains(UserId))
                             {
                                 Amount = 10000;