Commit 35841dda authored by 黄奎's avatar 黄奎

页面修改

parent c066e585
......@@ -89,5 +89,10 @@ namespace Edu.Model.ViewModel.StudyAbroad
/// 留学国家名称
/// </summary>
public string StudyCountryName { get; set; }
/// <summary>
/// 产品类型名称
/// </summary>
public string ProductTypeName { get; set; }
}
}
......@@ -19,5 +19,10 @@ namespace Edu.Model.ViewModel.StudyAbroad
/// 修改人
/// </summary>
public string UpdateByName { get; set; }
/// <summary>
/// 留学国家名称
/// </summary>
public string CountryName { get; set; }
}
}
......@@ -458,6 +458,22 @@ namespace Edu.Module.StudyAbroad
public List<RB_Studyabroad_Type_Extend> GetStudyabroadTypePageModule(int pageIndex, int pageSize, out long rowsCount, RB_Studyabroad_Type_Extend query)
{
var list = studyabroad_TypeRepository.GetStudyabroadTypePageRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
string countryIds = string.Join(",", list.Select(qitem => qitem.CountryId));
List<RB_Destination_ViewModel> countryList = new List<RB_Destination_ViewModel>();
if (!string.IsNullOrEmpty(countryIds))
{
countryList= destinationRepository.GetDestinationListRepository(new RB_Destination_ViewModel()
{
Ids=countryIds
});
}
foreach (var item in list)
{
item.CountryName = countryList?.FirstOrDefault(qitem => qitem.ID == item.CountryId)?.Name ?? "";
}
}
return list;
}
......
......@@ -29,9 +29,10 @@ namespace Edu.Repository.StudyAbroad
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.`Name`,'') AS SupplierName,IFNULL(B.ContractUrl,'') AS ContractUrl,IFNULL(c.SName,'') AS SchoolName
SELECT A.*,IFNULL(B.`Name`,'') AS SupplierName,IFNULL(B.ContractUrl,'') AS ContractUrl,IFNULL(c.SName,'') AS SchoolName,IFNULL(D.`Name`,'') AS ProductTypeName
FROM RB_StudyAbroad AS A LEFT JOIN rb_supplier AS B ON A.SupplierId=B.Id
LEFT JOIN rb_school AS C ON A.School_Id=C.SId
LEFT JOIN rb_studyabroad_type AS D ON A.ProductType=D.Id
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1}", nameof(RB_StudyAbroad_ViewModel.Status), (int)DateStateEnum.Normal);
......
......@@ -46,6 +46,11 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Studyabroad_Type_Extend.CountryId), query.CountryId);
}
if (!string.IsNullOrEmpty(query.Name))
{
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_Studyabroad_Type_Extend.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
}
builder.AppendFormat(" ORDER BY A.{0} ", nameof(RB_Studyabroad_Type_Extend.Num));
......@@ -82,6 +87,11 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Studyabroad_Type_Extend.CountryId), query.CountryId);
}
if (!string.IsNullOrEmpty(query.Name))
{
builder.AppendFormat(" AND A.{0} LIKE @CourseName ", nameof(RB_Studyabroad_Type_Extend.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
}
builder.AppendFormat(" ORDER BY A.{0} ", nameof(RB_Studyabroad_Type_Extend.Num));
return Get<RB_Studyabroad_Type_Extend>(builder.ToString(), parameters).ToList();
......
......@@ -280,7 +280,7 @@ namespace Edu.WebApi.Controllers.StudyAbroad
item.ImgCover,
item.Status,
item.ProductType,
ProductTypeName = item.ProductType.ToName(),
item.ProductTypeName,
item.StudyFeature,
item.StudyCountryId,
item.StudyCountryName,
......@@ -706,7 +706,6 @@ namespace Edu.WebApi.Controllers.StudyAbroad
Type = base.ParmJObj.GetInt("Type"),
CountryId = base.ParmJObj.GetInt("CountryId"),
};
query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>();
var list = studyAbroadModule.GetStudyabroadTypePageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
......@@ -727,6 +726,7 @@ namespace Edu.WebApi.Controllers.StudyAbroad
item.Type,
item.Name,
item.CountryId,
item.CountryName,
item.CreateBy,
item.CreateByName,
item.UpdateBy,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment