Commit d8216f93 authored by 黄奎's avatar 黄奎

页面修改

parent da89d984
......@@ -258,8 +258,10 @@ namespace Mall.Module.Miai
public List<RB_Assess_Goods_Extend> GetGoodsPageList(int pageIndex, int pageSize, out long count, RB_Assess_Goods_Extend demodel)
{
var list = assess_GoodsRepository.GetPageList(pageIndex, pageSize, out count, demodel);
if (list.Any()) {
foreach (var item in list) {
if (list.Any())
{
foreach (var item in list)
{
item.GoodsImgList = new List<AssessBrandImg>();
item.MoreImgList = new List<AssessBrandImg>();
if (!string.IsNullOrEmpty(item.GoodsImg))
......
......@@ -4,6 +4,7 @@ using System.Text;
using Mall.Model.Entity.Assess;
using Mall.Model.Extend.Assess;
using System.Linq;
using VT.FW.DB.Dapper;
namespace Mall.Repository.Assess
{
......@@ -23,6 +24,7 @@ namespace Mall.Repository.Assess
/// <returns></returns>
public List<RB_Assess_Goods_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Assess_Goods_Extend dmodel)
{
var parameters = new DynamicParameters();
string where = $" 1=1 and e.{nameof(RB_Assess_Goods_Extend.Status)}=0 ";
if (dmodel.TenantId > 0) {
where += $@" and e.{nameof(RB_Assess_Goods_Extend.TenantId)}={dmodel.TenantId}";
......@@ -43,20 +45,27 @@ namespace Mall.Repository.Assess
{
where += $@" and e.{nameof(RB_Assess_Goods_Extend.UserId)} ={dmodel.UserId}";
}
if (!string.IsNullOrEmpty(dmodel.BrandName))
{
where += $@" and b.{nameof(RB_Assess_Brand_Extend.Name)} like @BrandName";
parameters.Add("BrandName", "%" + dmodel.BrandName + "%");
}
if (dmodel.IsReply == 1)
{
where += $" and IFNULL(e.{nameof(RB_Assess_Goods_Extend.ReplyContent)},'') <>''";
}
else if (dmodel.IsReply == 2) {
else if (dmodel.IsReply == 2)
{
where += $" and IFNULL(e.{nameof(RB_Assess_Goods_Extend.ReplyContent)},'') =''";
}
string sql = $@"select e.*,u.Name as UserName,u.Photo as EmpPhoto,c.Name as CategoryName,b.Name as BrandName from RB_Assess_Goods e
inner join rb_member_user u on e.UserId = u.Id
left join rb_assess_category c on e.CategoryId =c.Id
left join rb_assess_brand b on e.BrandId = b.Id
string sql = $@"
select e.*,u.Name as UserName,u.Photo as EmpPhoto,c.Name as CategoryName,b.Name as BrandName
from RB_Assess_Goods e inner join rb_member_user u on e.UserId = u.Id
left join rb_assess_category c on e.CategoryId =c.Id
left join rb_assess_brand b on e.BrandId = b.Id
where {where} order by e.Id desc";
return GetPage<RB_Assess_Goods_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
return GetPage<RB_Assess_Goods_Extend>(pageIndex, pageSize, out rowCount, sql, parameters).ToList();
}
}
......
......@@ -301,6 +301,7 @@ namespace Mall.WebApi.Controllers.MallBase
BrandId=jobj.GetInt("BrandId"),
UserId=jobj.GetInt("UserId"),
IsReply=jobj.GetInt("IsReply"),
BrandName=jobj.GetStringValue("BrandName"),
};
demodel.TenantId = req.TenantId;
......
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