升级
This commit is contained in:
@@ -96,18 +96,24 @@ namespace WebAPI.Controllers
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <param name="personName"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getPersonByProjectIdUnitId(string projectId, string unitId, int pageIndex)
|
||||
public Model.ResponeData getPersonByProjectIdUnitId(string projectId, string unitId, int pageIndex, string personName = "")
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var getDataList = APIPersonService.getPersonByProjectIdUnitId(projectId, unitId);
|
||||
if (!string.IsNullOrEmpty(personName))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.PersonName.Contains(personName)).ToList();
|
||||
}
|
||||
int pageCount = getDataList.Count;
|
||||
if (pageCount > 0 && pageIndex > 0)
|
||||
{
|
||||
getDataList = getDataList.Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize).ToList();
|
||||
}
|
||||
getDataList = getDataList.OrderBy(x => x.PersonName).ToList();
|
||||
responeData.data = new { pageCount, getDataList };
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user