diff --git a/app/oa/controller/Schedule.php b/app/oa/controller/Schedule.php index 5576bf4..b4da66e 100644 --- a/app/oa/controller/Schedule.php +++ b/app/oa/controller/Schedule.php @@ -21,26 +21,27 @@ class Schedule extends BaseController if (request()->isAjax()) { $param = get_params(); //按时间检索 - $start_time = isset($param['start_time']) ? strtotime($param['start_time']) : 0; + $start_time = isset($param['start_time']) ? strtotime($param['start_time']) : 0; $end_time = isset($param['end_time']) ? strtotime($param['end_time']) : 0; + $tid = isset($param['tid']) ? $param['tid'] : 0; $where = []; - if ($start_time > 0 && $end_time > 0) { - $where[] = ['a.start_time', 'between', [$start_time, $end_time]]; - } - if (!empty($param['tid']) && $param['tid']>0) { + if ($tid>0) { $task_ids = Db::name('ProjectTask')->where(['delete_time' => 0, 'project_id' => $param['tid']])->column('id'); - if (!empty($task_ids)) { - $where[] = ['a.tid', 'in', $task_ids]; + $where[] = ['a.tid', 'in', $task_ids]; + } + else{ + if (!empty($param['uid'])) { + $where[] = ['a.admin_id', '=', $param['uid']]; + } else { + $where[] = ['a.admin_id', '=', $this->uid]; } - } - if (!empty($param['keywords'])) { - $where[] = ['a.title', 'like', '%' . trim($param['keywords']) . '%']; - } - if (!empty($param['uid'])) { - $where[] = ['a.admin_id', '=', $param['uid']]; - } else { - $where[] = ['a.admin_id', '=', $this->uid]; - } + if (!empty($param['keywords'])) { + $where[] = ['a.title', 'like', '%' . trim($param['keywords']) . '%']; + } + if ($start_time > 0 && $end_time > 0) { + $where[] = ['a.start_time', 'between', [$start_time, $end_time]]; + } + } $where[] = ['a.delete_time', '=', 0]; $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; $schedule = ScheduleList::where($where) diff --git a/app/project/model/ProjectLog.php b/app/project/model/ProjectLog.php index f31fb33..588463b 100644 --- a/app/project/model/ProjectLog.php +++ b/app/project/model/ProjectLog.php @@ -15,7 +15,7 @@ class ProjectLog extends Model { public static $Sourse = [ 'project' => [ - 'status' => ['未开始', '进行中', '已完成', '已关闭'], + 'status' => ['','未开始', '进行中', '已完成', '已关闭'], 'field_array' => [ 'director_uid' => array('icon' => 'icon-xueshengzhuce', 'title' => '负责人'), 'start_time' => array('icon' => 'icon-kaoshijihua', 'title' => '预计开始时间'), diff --git a/app/project/view/index/view_schedule.html b/app/project/view/index/view_schedule.html index cff7e1b..54a4388 100644 --- a/app/project/view/index/view_schedule.html +++ b/app/project/view/index/view_schedule.html @@ -39,7 +39,7 @@ function schedule(){ } , { field: 'labor_time', title: '工时', style: 'color: #91CC75;', align: 'center', width: 60 } , { field: 'labor_type_string', title: '工作类型', align: 'center', width: 90 } - , { field: 'work_cate', title: '工作类别', align: 'center', width: 100 } + , { field: 'cate', title: '工作类别', align: 'center', width: 100 } , { field: 'title', title: '工作内容' } , { field: 'name', title: '执行员工', align: 'center', width: 80 } , { field: 'department', title: '所在部门', align: 'center', width: 100 }