修复日历事件共享bug

This commit is contained in:
2021-07-28 05:09:38 +08:00
parent 7ffb549bc6
commit 566954dfcf
18 changed files with 188 additions and 124 deletions
@@ -21,17 +21,7 @@ class WidgetController extends DefaultController
->permission('receive_id')
->orderBy('created_at', 'desc');
// 查询是否已经阅读
$reader = function ($q) {
$q->selectRaw('1')
->from('article_reader')
->whereRaw('article_reader.article_id = article.id')
->where('article_reader.created_id', auth()->id());
};
$model->whereNotExists($reader);
$rows = $model->get(['id', 'name', 'created_at']);
$rows = $model->limit(15)->get(['id', 'name', 'created_at']);
$json['total'] = sizeof($rows);
$json['data'] = $rows;
return $json;
@@ -73,6 +63,7 @@ class WidgetController extends DefaultController
'count2' => $count2,
'rate' => $rate,
];
return $this->render([
'dates' => $config['dates'],
'info' => $config['info'],
+1 -1
View File
@@ -14,7 +14,7 @@ return [
'more_url' => 'article/article/index',
],
'info_article_index' => [
'name' => '新增公告',
'name' => '未读公告',
'type' => 2,
'url' => 'article/widget/info',
'more_url' => 'article/article/index',
+1 -1
View File
@@ -9,7 +9,7 @@
</a>
</div>
<div class="info-r">
<div>{{$dates[$info['params']['date']]}}</div>
<div>{{$dates[$info['params']['date']]}}</div>
<div class="rate @if($res['rate'] > 100) red @endif">{{$res['rate']}}%</div>
</div>
</div>