新增工作日历时读取工作类别错误修正

This commit is contained in:
hdm 2022-07-03 17:47:29 +08:00
parent 67bac9e3b2
commit f92733e5b6
4 changed files with 7 additions and 5 deletions

View File

@ -85,7 +85,7 @@ class Plan extends BaseController
->field('id,title,type,remind_type,start_time,end_time')
->select()->toArray();
$events = [];
$color_array=['#393D49','#FF5722','#FFB800','#1E9FFF','#12bb37'];
$color_array=['#393D49','#FF5722','#FFB800','#1E9FFF','#12bb37','#696969'];
foreach ($schedule as $k => $v) {
$v['backgroundColor'] = $color_array[$v['type']];
$v['borderColor'] = $color_array[$v['type']];
@ -134,9 +134,11 @@ class Plan extends BaseController
if ($param['end_time'] <= $param['start_time']) {
return to_assign(1, "结束时间需要大于开始时间");
}
/*
if ($param['start_time'] <= time()) {
return to_assign(1, "开始时间需要大于当前时间");
}
*/
if (isset($param['remind_type'])) {
if($param['remind_type']==1){
$param['remind_time'] = $param['start_time']-5*60;

View File

@ -45,7 +45,7 @@ class Schedule extends BaseController
$where[] = ['a.delete_time', '=', 0];
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
$schedule = ScheduleList::where($where)
->field('a.*,u.name,d.title as department,w.title as cate')
->field('a.*,u.name,d.title as department,w.title as work_cate')
->alias('a')
->join('Admin u', 'a.admin_id = u.id', 'LEFT')
->join('Department d', 'u.did = d.id', 'LEFT')

View File

@ -104,7 +104,7 @@
}
return html;
}}
,{field: 'cate', title: '工作类别', align:'center',width:80}
,{field: 'work_cate', title: '工作类别', align:'center',width:80}
,{field: 'start_time', title: '工作时间范围', align:'center',width:186,templet:function(d){
var html=d.start_time+'至'+d.end_time;
return html;

View File

@ -66,7 +66,7 @@ layui.define(['tool'], function (exports) {
<td class="layui-td-gray">所在部门</td>
<td>${detail.department}</td>
<td class="layui-td-gray">工作类别</td>
<td>${detail.cate}</td>
<td>${detail.work_cate}</td>
</tr>
<tr>
<td class="layui-td-gray">时间范围</td>
@ -156,7 +156,7 @@ layui.define(['tool'], function (exports) {
</td>
<td class="layui-td-gray">工作类别<font>*</font></td>
<td>
<select name="cid" lay-filter="work_cate" id="cid"></select>
<select name="cid" lay-filter="work_cate" id="work_cate"></select>
</td>
</tr>
<tr>