Commit 45c8eeb3 authored by 黄奎's avatar 黄奎

11

parent 71c1fc3f
......@@ -10,6 +10,14 @@ namespace Mall.Model.Extend.TradePavilion
/// </summary>
public class RB_Brand_Enterprise_Extend: RB_Brand_Enterprise
{
/// <summary>
/// 分类名称
/// </summary>
public string CategoryName { get; set; }
/// <summary>
/// 认证用户
/// </summary>
public string AuthUserName { get; set; }
}
}
......@@ -28,6 +28,10 @@ namespace Mall.Module.TradePavilion
/// 【商载通】 品牌、企业服务仓储层
/// </summary>
private readonly RB_Brand_EnterpriseRepository brand_EnterpriseRepository = new RB_Brand_EnterpriseRepository();
/// <summary>
/// 品牌分类信息仓储层对象
/// </summary>
private readonly RB_BrandClassRepository brandClassRepository = new RB_BrandClassRepository();
/// <summary>
/// 获取载体、楼宇分页列表
......@@ -216,6 +220,10 @@ namespace Mall.Module.TradePavilion
public RB_Brand_Enterprise_Extend GetBrandEnterpriseModule(int ID)
{
var extModel = brand_EnterpriseRepository.GetEntity<RB_Brand_Enterprise_Extend>(ID);
if (extModel != null && extModel.CategoryId > 0)
{
extModel.CategoryName = brandClassRepository.GetEntity(extModel.CategoryId)?.ClassName ?? "";
}
return extModel;
}
......
......@@ -25,7 +25,6 @@ namespace Mall.Repository.TradePavilion
{
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.ClassName,'') AS CategoryName
FROM rb_brand_Enterprise AS A LEFT JOIN rb_brandclass AS B ON A.CategoryId=B.ID
......@@ -42,6 +41,18 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Brand_Enterprise_Extend.MallBaseId), query.MallBaseId);
}
if (query.BrandEnterpriseType > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Brand_Enterprise_Extend.BrandEnterpriseType), query.BrandEnterpriseType);
}
if (query.CategoryId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Brand_Enterprise_Extend.CategoryId), query.CategoryId);
}
if (query.UserId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Brand_Enterprise_Extend.UserId), query.UserId);
}
if (!string.IsNullOrEmpty(query.BrandName))
{
builder.AppendFormat(" AND A.{0} LIKE @BrandName ", nameof(RB_Brand_Enterprise_Extend.BrandName));
......
......@@ -10,6 +10,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using COSXML.Log;
using Dnc.Api.Throttle;
using Mall.CacheManager.Base;
using Mall.CacheManager.User;
......@@ -3681,7 +3682,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
BrandEnterpriseType = parms.GetInt("BrandEnterpriseType"),
BrandName = parms.GetStringValue("BrandName"),
FullBrandName = parms.GetStringValue("FullBrandName"),
CategoryId = parms.GetInt("CategoryId"),
};
List<object> list = new List<object>();
var dataList = buildingCarrierModule.GetBrandEnterprisePageModule(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query);
......@@ -3691,8 +3692,16 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
item.ID,
item.BrandName,
item.FullBrandName,
item.CategoryId,
item.CategoryName,
item.Logo,
item.ShopNum,
item.BuiltUpArea,
item.EndBuiltUpArea,
item.BrandType,
item.CustomerType,
item.UserId,
item.AuthUserName,
CreateDate = Common.ConvertHelper.FormatDate(item.CreateDate),
});
}
......@@ -3768,8 +3777,49 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
int Id = parms.GetInt("ID");
if (Id <= 0)
{
return ApiResult.ParamIsNull(message: "编号不能为空!");
}
List<string> BannerList = new List<string>();
var extModel = buildingCarrierModule.GetBrandEnterpriseModule(Id);
return ApiResult.Success(data: extModel);
string Banner = extModel?.Banner ?? "";
if (!string.IsNullOrEmpty(Banner))
{
try
{
BannerList = Common.Plugin.JsonHelper.DeserializeObject<List<string>>(Banner);
}
catch
{
}
}
var dataObj = new
{
ID = extModel?.ID ?? 0,
BrandName = extModel?.BrandName ?? "",
FullBrandName = extModel?.FullBrandName ?? "",
VideoUrl = extModel?.VideoUrl ?? "",
Logo = extModel?.Logo ?? "",
ShopNum = extModel?.ShopNum ?? 0,
BuiltUpArea = extModel?.BuiltUpArea ?? 0,
EndBuiltUpArea = extModel?.EndBuiltUpArea ?? 0,
BrandType = extModel?.BrandType ?? "",
CustomerType = extModel?.CustomerType ?? "",
AreaRequirement = extModel?.AreaRequirement ?? 0,
EndAreaRequirement = extModel?.EndAreaRequirement ?? 0,
CategoryId = extModel?.CategoryId ?? 0,
CategoryName = extModel?.CategoryName ?? "",
BrandEnterpriseType = extModel?.BrandEnterpriseType ?? 0,
Introduce = extModel?.Introduce ?? "",
DevIntention = extModel?.DevIntention ?? "",
PropertyDemand = extModel?.PropertyDemand ?? "",
Cooperation = extModel?.Cooperation ?? "",
Complementary = extModel?.Complementary ?? "",
BannerList,
};
return ApiResult.Success(data: dataObj);
}
/// <summary>
......
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