From e683a19e4945129b045be2463dc3d5b0dfb860b2 Mon Sep 17 00:00:00 2001 From: kf_wuhao <15392746632@qq.com> Date: Tue, 2 Mar 2021 18:03:41 +0800 Subject: [PATCH] 1 --- pmcalendar.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pmcalendar.php b/pmcalendar.php index acb7d00..5840d17 100644 --- a/pmcalendar.php +++ b/pmcalendar.php @@ -235,7 +235,8 @@ if ($act == 'newevent') { $yanqi_history=$event['yanqi_history']; if (!$yanqi_history) $yanqi_history = '[]'; $yanqi_history = json_decode($yanqi_history,true); - $yanqi_history[] = array('date1'=>$event['start'],'date2'=>$dict['end'],'user'=>$user['name'],'reason'=>$reason); + $isYanqi = strtotime($event['start'])$isYanqi,'date1'=>$event['start'],'date2'=>$dict['end'],'user'=>$user['name'],'reason'=>$reason); $dict['yanqi_history']=json_encode($yanqi_history,true); $sql = DB::update('calendar', $dict, "id='{$id}'"); @@ -326,13 +327,16 @@ if ($act == 'newevent') { $gameName = $rs['game']; + $yanqi_history = json_decode($rs['yanqi_history'],true); + $isYanqi = $yanqi_history?end($yanqi_history)['isYanqi']:0; + $row = array( 'id' => $rs['id'], 'title' => '【' . $gameName . '】' . $rs['event'] . ":" . $rs['title'], 'start' => $rs['start'], 'end' => $rs['end'], 'className' => 'label-' . $class, - 'isYanqi'=>boolval($rs['yanqi_history']) + 'isYanqi'=> $isYanqi ); $row['allDay'] = true; $res[] = $row; @@ -1873,10 +1877,12 @@ if ($act == 'newevent') { eventRender: function (event, element) { // console.log(event) // console.log(element) - if(event.isYanqi){ + if(event.isYanqi == 1){ element.html(event.title + ''); - }else { + }else if(event.isYanqi == 0) { element.html(event.title); + } else { + element.html(event.title + ''); } },