活动和列表
This commit is contained in:
@@ -52,6 +52,36 @@ namespace Home.Controllers
|
||||
var ret = await m_ProductRouteService.Query(exp).OrderBy(m=>m.Sort).ToListAsync();
|
||||
|
||||
|
||||
var products = await m_ProductService.Query(m=>m.OnLine == 1).OrderBy(m=>m.Sort).ToListAsync();
|
||||
ViewData["products"] = products;
|
||||
return View(ret);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> Index2([FromQuery]LineSearchModel request)
|
||||
{
|
||||
request = request ?? new LineSearchModel();
|
||||
Expression<Func<ProductRouteEntity, bool>> exp =null;
|
||||
|
||||
if (request.ProductId > 0)
|
||||
{
|
||||
exp = m => m.ProductId == request.ProductId;
|
||||
}
|
||||
|
||||
if (request.KeyWord.Has())
|
||||
{
|
||||
Expression<Func<ProductRouteEntity, bool>> filterExpr = m =>
|
||||
m.Province.Contains(request.KeyWord)
|
||||
|| m.City.Contains(request.KeyWord)
|
||||
|| m.Name.Contains(request.KeyWord)
|
||||
|| m.ServerUrl.Contains(request.KeyWord);
|
||||
if (exp == null)
|
||||
exp = filterExpr;
|
||||
else exp=exp.And(filterExpr);
|
||||
}
|
||||
|
||||
var ret = await m_ProductRouteService.Query(exp).OrderBy(m=>m.Sort).ToListAsync();
|
||||
|
||||
|
||||
var products = await m_ProductService.Query(m=>m.OnLine == 1).OrderBy(m=>m.Sort).ToListAsync();
|
||||
ViewData["products"] = products;
|
||||
return View(ret);
|
||||
|
||||
Reference in New Issue
Block a user