lihao пре 4 година
родитељ
комит
b50116bc52

+ 5 - 4
gx_api/GxPress/Service/GxPress.Service.Implement/CommonSqlKata/CommonSqlKataService.cs

@@ -1,3 +1,4 @@
+using GxPress.EnumConst;
 using GxPress.Service.Interface.CommonSqlKata;
 namespace GxPress.Service.Implement.CommonSqlKataService
 {
@@ -147,10 +148,10 @@ namespace GxPress.Service.Implement.CommonSqlKataService
             IsFlowAdmin.Where("tede_flow.UserId", userId);
             IsFlowAdmin.AsCount();
             query.Select(IsFlowAdmin, "IsFlowAdmin");
-            var FileCount = new SqlKata.Query("tede_middle");
-            FileCount.WhereColumns("tede_middle.ParentId", "=", "tede_middle.Id");
-            FileCount.Where("tede_middle.IsDelete", false);
-            FileCount.WhereNot("tede_middle.NoticeAddresseeType", 2); ;
+            var FileCount = new SqlKata.Query().From("tede_middle as a");
+            FileCount.WhereColumns("a.ParentId", "=", "tede_middle.Id");
+            FileCount.Where("a.IsDelete", false);
+            FileCount.WhereNot("a.NoticeAddresseeType", NoticeTypeConst.Draft.GetHashCode()); ;
             FileCount.AsCount();
             query.Select(FileCount, "FileCount");
             var ReadCount = new SqlKata.Query("tede_addressee");