sunpengfei
2025-08-12 421b883ad4a46a680c9312101febcf190bc5f128
FlexJobApi.Core/Models/FlexJobServer/Tasks/Repositories/TaskInfoRepository.cs
@@ -18,13 +18,18 @@
        /// 获取任务查询
        /// </summary>
        /// <param name="rep"></param>
        /// <param name="tracking"></param>
        /// <param name="logier"></param>
        /// <returns></returns>
        public static IQueryable<TaskInfo> GetQueryable(this IRepository<TaskInfo> rep, CurrentLogier logier = null)
        public static IQueryable<TaskInfo> GetQueryable(this IRepository<TaskInfo> rep, bool tracking = true, CurrentLogier logier = null)
        {
            logier = logier ?? JwtUtils.GetCurrentLogier();
            IQueryable<TaskInfo> q = rep.AsQueryable().AsNoTracking()
                 .OrderBy(it => it.BeginTime);
            var q = rep.AsQueryable();
            if (tracking)
            {
                q = q.AsNoTracking();
            }
            q = q.OrderBy(it => it.BeginTime);
            if (logier != null && logier.Type == EnumUserType.Enterprise)
            {
                q = q.Where(it => it.EnterpriseId == logier.EnterpriseId);