gaobingyue лет назад: 5
Родитель
Сommit
cbc6ba93ff

+ 4 - 4
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/RegRecords/RegRecordsController.cs

77
 
77
 
78
                 //已接收非本部门的数据不可看到
78
                 //已接收非本部门的数据不可看到
79
                 sql += @" and (isnull((
79
                 sql += @" and (isnull((
80
-select F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 ),0)=0 or
80
+select top 1 F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1  order by F_Id desc),0)=0 or
81
 isnull((
81
 isnull((
82
-select F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 ),0)=
82
+select  top 1 F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 order by F_Id desc ),0)=
83
 " + CurrentUser.UserData.F_DeptId + ")";
83
 " + CurrentUser.UserData.F_DeptId + ")";
84
 
84
 
85
 
85
 
88
 
88
 
89
                 //已接收非本部门的数据不可看到
89
                 //已接收非本部门的数据不可看到
90
                 sql += @" and (isnull((
90
                 sql += @" and (isnull((
91
-select F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 ),0)=0 or
91
+select top 1 F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 order by F_Id desc ),0)=0 or
92
 isnull((
92
 isnull((
93
-select F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 ),0)=
93
+select top 1 F_Bdeptid from T_Sys_ATheChangeLog where F_CustomerId=T_Rec_RegRecords.F_Id and F_type=1 order by F_Id desc ),0)=
94
 " + CurrentUser.UserData.F_DeptId + ")";
94
 " + CurrentUser.UserData.F_DeptId + ")";
95
                 if (Zsz != "")
95
                 if (Zsz != "")
96
                 {
96
                 {