feat: 完善渠道商管理

This commit is contained in:
ccnetcore
2026-01-05 00:11:06 +08:00
parent 88225a97b8
commit 69a8b47245
13 changed files with 63 additions and 5 deletions

View File

@@ -35,8 +35,9 @@ public class ModelService : ApplicationService, IModelService
{
RefAsync<int> total = 0;
// 查询所有未删除的模型使用WhereIF动态添加筛选条件
// 查询所有未删除且已启用的模型使用WhereIF动态添加筛选条件
var modelIds = (await _modelRepository._DbQueryable
.Where(x => x.IsEnabled)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), x =>
x.Name.Contains(input.SearchKey) || x.ModelId.Contains(input.SearchKey))
.WhereIF(input.ProviderNames is not null, x =>
@@ -51,6 +52,7 @@ public class ModelService : ApplicationService, IModelService
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total));
var entities = await _modelRepository._DbQueryable.Where(x => modelIds.Contains(x.ModelId))
.Where(x => x.IsEnabled)
.OrderBy(x => x.OrderNum)
.OrderBy(x => x.Name).ToListAsync();
@@ -77,7 +79,7 @@ public class ModelService : ApplicationService, IModelService
public async Task<List<string>> GetProviderListAsync()
{
var providers = await _modelRepository._DbQueryable
.Where(x => !x.IsDeleted)
.Where(x => !x.IsDeleted && x.IsEnabled)
.Where(x => !string.IsNullOrEmpty(x.ProviderName))
.GroupBy(x => x.ProviderName)
.OrderBy(x => x.OrderNum)