diff --git a/README.md b/README.md index 1a832c0b..6f18405b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Gdoo协同办公
-
+
diff --git a/app/Gdoo/Article/Controllers/ArticleController.php b/app/Gdoo/Article/Controllers/ArticleController.php
index 238bf42c..10af1cc1 100644
--- a/app/Gdoo/Article/Controllers/ArticleController.php
+++ b/app/Gdoo/Article/Controllers/ArticleController.php
@@ -43,6 +43,16 @@ class ArticleController extends DefaultController
'display' => $this->access['edit'],
]];
+ $header['buttons'] = [
+ ['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => $this->access['delete']],
+ ['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
+ ];
+
+ $header['cols'] = $cols;
+ $header['tabs'] = Article::$tabs;
+ $header['bys'] = Article::$bys;
+ $header['js'] = Grid::js($header);
+
$search = $header['search_form'];
$query = $search['query'];
@@ -64,13 +74,14 @@ class ArticleController extends DefaultController
$model->permission('receive_id', null, false, true, false, 'created_id');
}
- // 查询是否已经阅读
+ // 是否已经阅读
$reader = function ($q) {
$q->selectRaw('1')
->from('article_reader')
->whereRaw('article_reader.article_id = article.id')
->where('article_reader.created_id', auth()->id());
};
+
if ($query['tab'] == 'done') {
$model->whereExists($reader);
}
@@ -81,27 +92,11 @@ class ArticleController extends DefaultController
$model->select($header['select']);
$rows = $model->paginate($query['limit'])->appends($query);
- $header['cols'] = $cols;
- $header['tabs'] = Article::$tabs;
- $header['bys'] = Article::$bys;
- $header['js'] = Grid::js($header);
-
- $items = Grid::dataFilters($rows, $header, function($item) {
+ return Grid::dataFilters($rows, $header, function($item) {
return $item;
});
- return $items;
}
- $header['buttons'] = [
- ['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => $this->access['delete']],
- ['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
- ];
-
- $header['cols'] = $cols;
- $header['tabs'] = Article::$tabs;
- $header['bys'] = Article::$bys;
- $header['js'] = Grid::js($header);
-
return $this->display([
'header' => $header,
]);
diff --git a/app/Gdoo/Article/Controllers/WidgetController.php b/app/Gdoo/Article/Controllers/WidgetController.php
index fb28d1e1..40cf8e90 100644
--- a/app/Gdoo/Article/Controllers/WidgetController.php
+++ b/app/Gdoo/Article/Controllers/WidgetController.php
@@ -30,7 +30,7 @@ class WidgetController extends DefaultController
};
$model->whereNotExists($reader);
- $rows = $model->get(['id', 'title', 'created_at']);
+ $rows = $model->get(['id', 'name', 'created_at']);
$json['total'] = sizeof($rows);
$json['data'] = $rows;
diff --git a/app/Gdoo/Article/views/article/index.blade.php b/app/Gdoo/Article/views/article/index.blade.php
index 4745fd80..c245a286 100644
--- a/app/Gdoo/Article/views/article/index.blade.php
+++ b/app/Gdoo/Article/views/article/index.blade.php
@@ -1,59 +1,66 @@
-{{$header["js"]}}
-
-
$2>")+h[2],o=h[0];o--;)a=a.lastChild;if(!u.leadingWhitespace&&st.test(s)&&g.push(e.createTextNode(st.exec(s)[0])),!u.tbody)for(o=(s="table"!==l||lt.test(s)?"