Commit 8d52ca41 authored by 黄奎's avatar 黄奎

页面修改

parent a6b7713d
......@@ -76,5 +76,10 @@ namespace Mall.Model.Extend.TradePavilion
return str;
}
}
/// <summary>
/// 报名人数
/// </summary>
public int JoinNum { get; set; }
}
}
......@@ -10,7 +10,14 @@ namespace Mall.Model.Extend.TradePavilion
/// </summary>
public class RB_Commerce_Consult_Extend: RB_Commerce_Consult
{
/// <summary>
/// 活动编号【查询使用】
/// </summary>
public string QActivityIds { get; set; }
/// <summary>
/// 用户编号【查询使用】
/// </summary>
public string QUserIds { get; set; }
}
}
......@@ -26,6 +26,11 @@ namespace Mall.Module.TradePavilion
/// </summary>
private readonly RB_Commerce_DetailsRepository detailsRepository = new RB_Commerce_DetailsRepository();
/// <summary>
/// 活动报名仓储层对象
/// </summary>
private readonly RB_Commerce_ConsultRepository commerce_ConsultRepository = new RB_Commerce_ConsultRepository();
#region 商户活动管理
/// <summary>
......@@ -35,10 +40,17 @@ namespace Mall.Module.TradePavilion
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <param name="isQuerySignup">是否查询报名名单</param>
/// <returns></returns>
public List<RB_Commerce_Activity_Extend> GetCommerceActivityPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Commerce_Activity_Extend query)
public List<RB_Commerce_Activity_Extend> GetCommerceActivityPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Commerce_Activity_Extend query,bool isQuerySignup)
{
return commerce_ActivityRepository.GetCommerceActivityPageListRepository(pageIndex, pageSize, out rowsCount, query);
var list= commerce_ActivityRepository.GetCommerceActivityPageListRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && isQuerySignup)
{
string ids = string.Join(",", list.Select(qitem => qitem.Id));
var joinList=
}
return list;
}
/// <summary>
......
......@@ -28,8 +28,9 @@ namespace Mall.Repository.TradePavilion
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.TypeName,'') AS ActivityTypeName
SELECT A.*,IFNULL(B.TypeName,'') AS ActivityTypeName,IFNULL(C.JoinNum,0) AS JoinNum
FROM rb_commerce_activity AS A LEFT JOIN rb_commerce_activitytype AS B ON A.ActivityType=B.Id
LEFT JOIN (SELECT ActivityId,COUNT(1) AS JoinNum FROM rb_commerce_consult WHERE `Status`=0 GROUP BY ActivityId) AS C ON A.Id=C.ActivityId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Commerce_Activity_Extend.Status), (int)DateStateEnum.Normal);
......
......@@ -52,6 +52,18 @@ WHERE 1=1
builder.AppendFormat(" AND {0} LIKE @Name ", nameof(RB_Commerce_Consult_Extend.LinkMan));
parameters.Add("Name", "%" + query.LinkMan.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.QActivityIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Commerce_Consult_Extend.ActivityId), query.QActivityIds);
}
if (!string.IsNullOrEmpty(query.QUserIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Commerce_Consult_Extend.UserId), query.QUserIds);
}
if (query.UserId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_Consult_Extend.UserId), query.UserId);
}
}
return GetPage<RB_Commerce_Consult_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
......
......@@ -152,5 +152,30 @@ namespace Mall.WebApi.Controllers.TradePavilion
var extModel = activityModule.GetCommerceActivityModule(Id);
return ApiResult.Success(data: extModel);
}
/// <summary>
/// 新增修改商会活动报名
/// </summary>
/// <returns></returns>
public ApiResult SetCommerceConsult()
{
JObject jObj = JObject.Parse(RequestParm.msg.ToString());
var extModel = new RB_Commerce_Consult_Extend()
{
Id = jObj.GetInt("Id"),
ActivityId = jObj.GetInt("ActivityId"),
UserId = jObj.GetInt("UserId"),
LinkMan = jObj.GetStringValue("LinkMan"),
LinkTel = jObj.GetStringValue("LinkTel"),
};
extModel.Status = Common.Enum.DateStateEnum.Normal;
extModel.MallBaseId = RequestParm.MallBaseId;
extModel.TenantId = RequestParm.TenantId;
var userInfo = AppletUserInfo;
extModel.UserId = userInfo?.UserId??0;
extModel.CreateTime = DateTime.Now;
var flag = consultModule.SetCommerceConsultModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
}
}
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