@ -243,16 +243,16 @@ public class ClientCommonService : IClientCommonService
var exp = Expressionable . Create < InfoClient > ( ) ;
exp = exp . And ( c = > SqlFunc . Subqueryable < InfoClientStakeholder > ( ) . Where ( "SYSDATE() BETWEEN StartDate and EndDate" ) . Where ( x = > userids . Contains ( x . UserId . ToString ( ) ) & & x . ClientId = = c . Id ) . Any ( ) ) ;
var queryData1 = tenantDb . Queryable < InfoClient > ( ) . ClearFilter < ISharedOrgId > ( ) . Where ( c = > c . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( exp . ToExpression ( ) ) ;
var queryData2 = queryData . Where ( conditions ) ;
var queryData1 = tenantDb . Queryable < InfoClient > ( ) . ClearFilter < ISharedOrgId > ( ) . Where ( c = > c . Status = = StatusEnum . Enable . ToEnumInt ( ) & & SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where (
b = > b . ClientId = = c . Id & & b . Value = = "isController" ) . Any ( ) ) . Where ( exp . ToExpression ( ) ) ;
var queryData2 = queryData . Where ( c = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where (
b = > b . ClientId = = c . Id & & b . Value = = "isController" ) . Any ( ) ) . Where ( conditions ) ;
var queryData0 = tenantDb . UnionAll ( queryData1 , queryData2 ) ;
//code = code.ToLower();
var data = await queryData0
. Where ( ( a ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where (
b = > b . ClientId = = a . Id & & b . Value = = "isController" ) . Any ( ) ) //&& c.CreateBy == long.Parse(user.UserId) && c.StartDate <= DateTime.Now && c.EndDate >= DateTime.Now
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) //&& c.CreateBy == long.Parse(user.UserId) && c.StartDate <= DateTime.Now && c.EndDate >= DateTime.Now
. WhereIF ( ! string . IsNullOrEmpty ( queryKey ) , ( a ) = > a . CodeName . Contains ( queryKey ) | | a . ShortName . Contains ( queryKey ) | | a . Description . Contains ( queryKey ) )
. Select ( ( a ) = > new ControllerClientRes
. WhereIF ( ! string . IsNullOrEmpty ( queryKey ) , a = > a . CodeName . Contains ( queryKey ) | | a . ShortName . Contains ( queryKey ) | | a . Description . Contains ( queryKey ) )
. Select ( a = > new ControllerClientRes
{
Id = a . Id ,
PinYinCode = a . ShortName + "(" + a . Description + ")" + " " + a . CodeName ,