Commit e5295f14 authored by liudong1993's avatar liudong1993

1调整首店

parent 92d415dd
......@@ -321,14 +321,14 @@ namespace Mall.Module.TradePavilion
//查询该榜单
var listModel = firstShop_ListRepository.GetEntity(listId);
if (listModel == null) { return null; }
var enrollList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = userInfo.MallBaseId, ListId = listId, UserId = userInfo.UserId });
if (enrollId > 0) { enrollList = enrollList.Where(x => x.Id != enrollId).ToList(); }//排除当前修改的
//var enrollList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = userInfo.MallBaseId, ListId = listId, UserId = userInfo.UserId });
//if (enrollId > 0) { enrollList = enrollList.Where(x => x.Id != enrollId).ToList(); }//排除当前修改的
//查询用户下所有的品牌
if (listModel.ObjectTypeIds.Contains("1"))
{
//品牌
var blist = brandRepository.GetBrandList(new RB_Brand_Extend() { MallBaseId = userInfo.MallBaseId, UserId = userInfo.UserId });
blist = blist.Where(x => !enrollList.Where(x => x.ObjectType == Common.Enum.TradePavilion.ListObjectTypeEnum.Brand).Select(y => y.ObjectId).Contains(x.ID)).ToList();
//blist = blist.Where(x => !enrollList.Where(x => x.ObjectType == Common.Enum.TradePavilion.ListObjectTypeEnum.Brand).Select(y => y.ObjectId).Contains(x.ID)).ToList();
if (blist.Any())
{
foreach (var item in blist)
......@@ -346,7 +346,7 @@ namespace Mall.Module.TradePavilion
if (listModel.ObjectTypeIds.Contains("2"))
{
var clist = carrierRepository.GetCarrierList(new RB_Carrier_Extend() { MallBaseId = userInfo.MallBaseId, UserId = userInfo.UserId });
clist = clist.Where(x => !enrollList.Where(x => x.ObjectType == Common.Enum.TradePavilion.ListObjectTypeEnum.Carrier).Select(y => y.ObjectId).Contains(x.ID)).ToList();
//clist = clist.Where(x => !enrollList.Where(x => x.ObjectType == Common.Enum.TradePavilion.ListObjectTypeEnum.Carrier).Select(y => y.ObjectId).Contains(x.ID)).ToList();
if (clist.Any())
{
foreach (var item in clist)
......@@ -386,11 +386,11 @@ namespace Mall.Module.TradePavilion
if (demodel.Id > 0)
{
#region 验证
var valistList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = demodel.MallBaseId, ListId = demodel.ListId, UserId = demodel.UserId, ObjectType = demodel.ObjectType });
if (valistList.Where(x => x.Id != demodel.Id).Any())
{
return "该品牌/载体已报名,无法重复报名";
}
//var valistList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = demodel.MallBaseId, ListId = demodel.ListId, UserId = demodel.UserId, ObjectType = demodel.ObjectType });
//if (valistList.Where(x => x.Id != demodel.Id).Any())
//{
// return "该品牌/载体已报名,无法重复报名";
//}
#endregion
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_FirstShop_ListEnroll_Extend.ObjectType),demodel.ObjectType},
......@@ -410,11 +410,11 @@ namespace Mall.Module.TradePavilion
else
{
#region 验证
var valistList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = demodel.MallBaseId, ListId = demodel.ListId, UserId = demodel.UserId, ObjectType = demodel.ObjectType });
if (valistList.Any())
{
return "该品牌/载体已报名,无法重复报名";
}
//var valistList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = demodel.MallBaseId, ListId = demodel.ListId, UserId = demodel.UserId, ObjectType = demodel.ObjectType });
//if (valistList.Any())
//{
// return "该品牌/载体已报名,无法重复报名";
//}
#endregion
bool flag = firstShop_ListEnrollRepository.Insert(demodel) > 0;
return flag ? "" : "报名失败,请联系管理人员";
......
......@@ -192,9 +192,9 @@ where {where} order by w.Id desc
where += $@" and e.{nameof(RB_FirstShop_ListEnroll_Extend.UserId)}={dmodel.CreateBy}";
}
string sql = $@"select w.*,e.ObjectType,e.ObjectId,e.Rank,e.MedalImage,e.RankListState from RB_FirstShop_List w
string sql = $@"select w.*,e.Id as EnrollId,e.ObjectType,e.ObjectId,e.Rank,e.MedalImage,e.RankListState from RB_FirstShop_List w
left join rb_firstshop_listenroll e on w.Id = e.ListId
where {where} group by w.Id,e.ObjectType,e.ObjectId order by w.EndDate desc
where {where} group by w.Id,e.Id,e.ObjectType,e.ObjectId order by w.EndDate desc
";
return GetPage<RB_FirstShop_List_Extend>(pageIndex, pageSize, out count, sql, parameters).ToList();
}
......
......@@ -2081,6 +2081,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
RB_FirstShop_List_Extend demodel = JsonHelper.DeserializeObject<RB_FirstShop_List_Extend>(req.msg.ToString());
demodel.TenantId = req.TenantId;
demodel.MallBaseId = req.MallBaseId;
demodel.OrderBy = 1;
var list = firstShopListModule.GetFirstShopListPageList(pageModel.pageIndex, pageModel.pageSize, out long count, demodel);
pageModel.count = Convert.ToInt32(count);
......
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