ปรับปรุงให้แสดงผลรวม ของจำนวนพนักงาน และปรับ layout
This commit is contained in:
@@ -102,6 +102,12 @@ namespace TodoAPI2.Models
|
||||
|
||||
public List<eva_limit_frame_groupViewModel> GetListBySearch(eva_limit_frame_groupSearchModel model)
|
||||
{
|
||||
var group_count = (from i in _repository.Context.eva_limit_frame_employee
|
||||
join j in _repository.Context.eva_limit_frame_group on i.frame_group_guid equals j.id
|
||||
where j.frame_plan_guid == model.frame_plan_guid
|
||||
group i.id by j.id into g
|
||||
select new { gid = g.Key, emp = g.Count() }).ToList();
|
||||
|
||||
var data = (
|
||||
from m_eva_limit_frame_group in _repository.Context.eva_limit_frame_group
|
||||
|
||||
@@ -114,13 +120,13 @@ namespace TodoAPI2.Models
|
||||
from fk_eva_evaluation_groupResult2 in eva_evaluation_groupResult2.DefaultIfEmpty()
|
||||
|
||||
|
||||
where
|
||||
1 == 1
|
||||
where
|
||||
1 == 1
|
||||
&& (!model.frame_plan_guid.HasValue || m_eva_limit_frame_group.frame_plan_guid == model.frame_plan_guid)
|
||||
&& (!model.group_guid.HasValue || m_eva_limit_frame_group.group_guid == model.group_guid)
|
||||
|
||||
|
||||
orderby fk_eva_evaluation_groupResult2.code
|
||||
orderby fk_eva_evaluation_groupResult2.code
|
||||
select new eva_limit_frame_groupViewModel()
|
||||
{
|
||||
id = m_eva_limit_frame_group.id,
|
||||
@@ -135,6 +141,8 @@ namespace TodoAPI2.Models
|
||||
frame_plan_guid_eva_limit_frame_plan_executed_date = fk_eva_limit_frame_planResult1.executed_date,
|
||||
group_guid_eva_evaluation_group_code = fk_eva_evaluation_groupResult2.thegroup,
|
||||
|
||||
emp_qty = (from x in group_count where x.gid == m_eva_limit_frame_group.id select x.emp).FirstOrDefault(),
|
||||
|
||||
isActive = m_eva_limit_frame_group.isActive,
|
||||
Created = m_eva_limit_frame_group.created,
|
||||
Updated = m_eva_limit_frame_group.updated
|
||||
|
||||
@@ -31,6 +31,8 @@ namespace TodoAPI2.Models
|
||||
public DateTime? frame_plan_guid_eva_limit_frame_plan_executed_date { get; set; }
|
||||
public string group_guid_eva_evaluation_group_code { get; set; }
|
||||
|
||||
public int? emp_qty { get; set; }
|
||||
|
||||
public string remark_formatted {
|
||||
get
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user