Commit 9b9a7d1c authored by 吴春's avatar 吴春

提交代码

parent 353824aa
......@@ -105,7 +105,7 @@ on a.TeacherId=b.ID WHERE a.{nameof(RB_Education_FollowTeacher_Extend.Status)}=
{
StringBuilder builder = new StringBuilder();
builder.Append(@$" SELECT a.*,b.OpenId FROM rb_education_followteacher as a LEFT JOIN rb_member_user as b
on a.UserId=b.ID WHERE a.{nameof(RB_Education_FollowTeacher_Extend.Status)}=0 and b.{nameof(RB_Education_Teacher_Extend.TeacherStatus)}=1");
on a.UserId=b.ID WHERE a.{nameof(RB_Education_FollowTeacher_Extend.Status)}=0 ");
if (query != null)
{
if (query.TenantId > 0)
......
......@@ -199,7 +199,7 @@ union all SELECT a.TenantId,a.MallBaseId,a.CreateBy,a.id,a.UserTeacher,a.Content
}
if (model.CreateBy > 0)
{
where += $@" and a.CreateBy = {model.CreateBy} ";
// where += $@" and a.CreateBy = {model.CreateBy} ";
likeWhere += $@" and l.UserId = {model.CreateBy} ";
}
}
......
......@@ -1370,12 +1370,12 @@ namespace Mall.WebApi.Controllers.Education
article.Status = 0;
if (dynamicModule.PublishDynamic(article))
{
//var oldList = educationModule.GetFollowUserList(new RB_Education_FollowTeacher_Extend { TeacherId = userInfo.UserTeacher, MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId });
//if (oldList != null && oldList.Any())//有关注的人
//{
// List<string> openIds = oldList.Select(x => x.OpenId).ToList();
// new MiniProgramMsgModule().SendEducationDynamicMsg(userInfo.TenantId, userInfo.MallBaseId, openIds, "您关注的老师又有新动态了", teacherModel.Name, article.CreateTime.Value.ToString("yyyy年MM月dd日"));
//}
var oldList = educationModule.GetFollowUserList(new RB_Education_FollowTeacher_Extend { TeacherId = userInfo.UserTeacher, MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId });
if (oldList != null && oldList.Any())//有关注的人
{
List<string> openIds = oldList.Select(x => x.OpenId).ToList();
new MiniProgramMsgModule().SendEducationDynamicMsg(userInfo.TenantId, userInfo.MallBaseId, openIds, "您关注的老师又有新动态了", teacherModel.Name, article.CreateTime.Value.ToString("yyyy年MM月dd日"));
}
return ApiResult.Success("发布成功");
}
else
......
......@@ -451,22 +451,6 @@ namespace Mall.WebApi.Controllers.Education
myArticleList = openList;
DynamicStatus = 4;//关注查看更多
}
//if (myArticleList == null || !myArticleList.Any())//没关注没公开动态查看是否有必须关注的动态
//{
// if (myArticleList == null || !myArticleList.Any())
// {
// DynamicStatus = 3;//暂无动态
// }
// else
// {
// DynamicStatus = 4;//关注查看更多
// }
//}
//else
//{
// DynamicStatus = 2;//查看更多
//}
}
List<object> list = new List<object>();
foreach (var item in myArticleList)
......@@ -597,10 +581,10 @@ namespace Mall.WebApi.Controllers.Education
List<string> fileList = new List<string>();
if (!string.IsNullOrEmpty(article.Files))
{
fileList =JsonConvert.DeserializeObject<List<string>>(article.Files);
fileList = JsonConvert.DeserializeObject<List<string>>(article.Files);
}
//StringHelper.UrlEncode(StringHelper.FromUnicodeString(article.Content))
var resultData = new { id = article.Id, createEmpId = article.CreateBy, createEmName = article.CreateByName, crearteEmPhoto = article.CrearteByPhoto, createTime = article.CreateTime.HasValue ? StringHelper.DateFormatToString(article.CreateTime.Value) : "", content = StringHelper.FromUnicodeString(article.Content), coverPhoto = article.CoverPhoto, fileType = article.FileType, latAndLong = article.LatAndLong, address = article.Address, files = fileList, hasLike = article.HasLike, likeList = article.LikeList.Select(t => new { empId = t.UserId, empName = t.EmName, t.Id }), commentList = article.CommentList.Select(t => new { commentId = t.Id, empId = t.UserId, empName = t.UserName, byReplayEmpId = t.ByReplyEmpId, byReplayEmpName = t.ByReplyEmName, content = StringHelper.FromUnicodeString(t.Content) }) };
var resultData = new { id = article.Id, createEmpId = article.CreateBy, createEmName = article.CreateByName, crearteEmPhoto = article.CrearteByPhoto, YearTime = article.CreateTime.HasValue ? (article.CreateTime.Value.Year == System.DateTime.Now.Year ? "" : article.CreateTime.Value.ToString("yyyy")) : "", MonthTime = article.CreateTime.HasValue ? article.CreateTime.Value.ToString("MM") : "", DayTime = article.CreateTime.HasValue ? article.CreateTime.Value.ToString("dd") : "", createTime = article.CreateTime.HasValue ? StringHelper.DateFormatToString(article.CreateTime.Value) : "", content = StringHelper.FromUnicodeString(article.Content), coverPhoto = article.CoverPhoto, fileType = article.FileType, latAndLong = article.LatAndLong, address = article.Address, files = fileList, hasLike = article.HasLike, likeList = article.LikeList.Select(t => new { empId = t.UserId, empName = t.EmName, t.Id }), commentList = article.CommentList.Select(t => new { commentId = t.Id, empId = t.UserId, empName = t.UserName, byReplayEmpId = t.ByReplyEmpId, byReplayEmpName = t.ByReplyEmName, content = StringHelper.FromUnicodeString(t.Content) }) };
return resultData;
}
......
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