Commit c9a11038 authored by 黄奎's avatar 黄奎

页面修改

parent e943afc0
...@@ -29,5 +29,10 @@ namespace Edu.Model.ViewModel.User ...@@ -29,5 +29,10 @@ namespace Edu.Model.ViewModel.User
/// 部门id /// 部门id
/// </summary> /// </summary>
public int DeptId { get; set; } public int DeptId { get; set; }
/// <summary>
/// 查看时间
/// </summary>
public string LookTime { get; set; }
} }
} }
\ No newline at end of file
...@@ -158,6 +158,10 @@ namespace Edu.Repository.User ...@@ -158,6 +158,10 @@ namespace Edu.Repository.User
if (!string.IsNullOrEmpty(demodel.To)) { if (!string.IsNullOrEmpty(demodel.To)) {
where += $@" and (FIND_IN_SET(d.DeptId,'{demodel.To}') or d.DeptId =-1)"; where += $@" and (FIND_IN_SET(d.DeptId,'{demodel.To}') or d.DeptId =-1)";
} }
if (!string.IsNullOrEmpty(demodel.LookTime))
{
where += $@" and n.{nameof(RB_Notice.UpdateTime)} >='{demodel.LookTime}'";
}
string OrderBy = " n.Id desc"; string OrderBy = " n.Id desc";
if (demodel.OrderBy == 1) if (demodel.OrderBy == 1)
...@@ -169,9 +173,12 @@ namespace Edu.Repository.User ...@@ -169,9 +173,12 @@ namespace Edu.Repository.User
OrderBy = " n.Is_Top asc,n.UpdateTime desc"; OrderBy = " n.Is_Top asc,n.UpdateTime desc";
} }
string sql = $@" select n.* from RB_Notice n string sql = $@"
left join rb_notice_dept d on n.Id = d.NoticeId SELECT n.*
where {where} group by n.Id order by {OrderBy}"; FROM RB_Notice n LEFT JOIN rb_notice_dept d on n.Id = d.NoticeId
WHERE {where}
GROUP BY n.Id
ORDER BY {OrderBy}";
return GetPage<RB_Notice_ViewModel>(pageIndex, pageSize, out count, sql).ToList(); return GetPage<RB_Notice_ViewModel>(pageIndex, pageSize, out count, sql).ToList();
} }
} }
......
...@@ -221,9 +221,8 @@ namespace Edu.WebApi.Controllers.User ...@@ -221,9 +221,8 @@ namespace Edu.WebApi.Controllers.User
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.Plugin.LogHelper.Write(ex, "SetNoticeInfo_FileList");
} }
if (string.IsNullOrEmpty(demodel.From)) if (string.IsNullOrEmpty(demodel.From))
{ {
return ApiResult.ParamIsNull("请传递来源"); return ApiResult.ParamIsNull("请传递来源");
...@@ -232,7 +231,6 @@ namespace Edu.WebApi.Controllers.User ...@@ -232,7 +231,6 @@ namespace Edu.WebApi.Controllers.User
{ {
return ApiResult.ParamIsNull("请传递发送部门"); return ApiResult.ParamIsNull("请传递发送部门");
} }
if (string.IsNullOrEmpty(demodel.Title)) if (string.IsNullOrEmpty(demodel.Title))
{ {
return ApiResult.ParamIsNull("请输入标题"); return ApiResult.ParamIsNull("请输入标题");
......
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