diff --git a/CHANGELOG.md b/CHANGELOG.md index 00dd33e0..51ce29a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +### [v1.3.3](https://gitee.com/koogua/course-tencent-cloud/releases/v1.3.3)(2021-04-30) + +### 更新 + +- 前台增加文章发布功能 +- 增加文章,咨询,评价,评论相关事件站内提醒 +- 增加文章,咨询,评价,评论事件埋点 +- 后台首页增加若干统计项目 +- 后台增加文章审核功能 +- 重构积分历史记录 +- 优化在线统计方式 +- 优化前台界面 + ### [v1.3.2](https://gitee.com/koogua/course-tencent-cloud/releases/v1.3.2)(2021-04-20) ### 更新 diff --git a/app/Builders/NotificationList.php b/app/Builders/NotificationList.php new file mode 100644 index 00000000..21f684f1 --- /dev/null +++ b/app/Builders/NotificationList.php @@ -0,0 +1,44 @@ +getUsers($notifications); + + foreach ($notifications as $key => $notification) { + $notifications[$key]['sender'] = $users[$notification['sender_id']] ?? new \stdClass(); + $notifications[$key]['receiver'] = $users[$notification['receiver_id']] ?? new \stdClass(); + } + + return $notifications; + } + + public function getUsers(array $notifications) + { + $senderIds = kg_array_column($notifications, 'sender_id'); + $receiverIds = kg_array_column($notifications, 'receiver_id'); + $ids = array_merge($senderIds, $receiverIds); + + $userRepo = new UserRepo(); + + $users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']); + + $baseUrl = kg_cos_url(); + + $result = []; + + foreach ($users->toArray() as $user) { + $user['avatar'] = $baseUrl . $user['avatar']; + $result[$user['id']] = $user; + } + + return $result; + } + +} diff --git a/app/Caches/ArticleRelatedList.php b/app/Caches/ArticleRelatedList.php index de602a27..78c97f4b 100644 --- a/app/Caches/ArticleRelatedList.php +++ b/app/Caches/ArticleRelatedList.php @@ -40,7 +40,7 @@ class ArticleRelatedList extends Cache $where = [ 'tag_id' => $tagIds[$randKey], - 'published' => 1, + 'published' => ArticleModel::PUBLISH_APPROVED, ]; $pager = $articleRepo->paginate($where); diff --git a/app/Caches/ModerationStat.php b/app/Caches/ModerationStat.php new file mode 100644 index 00000000..518b76f3 --- /dev/null +++ b/app/Caches/ModerationStat.php @@ -0,0 +1,35 @@ +lifetime; + } + + public function getKey($id = null) + { + return 'moderation_stat'; + } + + public function getContent($id = null) + { + $statRepo = new StatRepo(); + + $articleCount = $statRepo->countPendingArticles(); + $commentCount = $statRepo->countPendingComments(); + + return [ + 'article_count' => $articleCount, + 'comment_count' => $commentCount, + ]; + } + +} diff --git a/app/Caches/SiteGlobalStat.php b/app/Caches/SiteGlobalStat.php index a1a66d98..37738ff9 100644 --- a/app/Caches/SiteGlobalStat.php +++ b/app/Caches/SiteGlobalStat.php @@ -2,10 +2,11 @@ namespace App\Caches; +use App\Repos\Article as ArticleRepo; +use App\Repos\Comment as CommentRepo; use App\Repos\Consult as ConsultRepo; use App\Repos\Course as CourseRepo; use App\Repos\ImGroup as GroupRepo; -use App\Repos\Order as OrderRepo; use App\Repos\Package as PackageRepo; use App\Repos\Review as ReviewRepo; use App\Repos\Topic as TopicRepo; @@ -14,7 +15,7 @@ use App\Repos\User as UserRepo; class SiteGlobalStat extends Cache { - protected $lifetime = 2 * 3600; + protected $lifetime = 15 * 60; public function getLifetime() { @@ -29,9 +30,10 @@ class SiteGlobalStat extends Cache public function getContent($id = null) { $courseRepo = new CourseRepo(); + $articleRepo = new ArticleRepo(); + $commentRepo = new CommentRepo(); $consultRepo = new ConsultRepo(); $groupRepo = new GroupRepo(); - $orderRepo = new OrderRepo(); $packageRepo = new PackageRepo(); $reviewRepo = new ReviewRepo(); $topicRepo = new TopicRepo(); @@ -39,9 +41,11 @@ class SiteGlobalStat extends Cache return [ 'course_count' => $courseRepo->countCourses(), + 'article_count' => $articleRepo->countArticles(), + 'comment_count' => $commentRepo->countComments(), 'consult_count' => $consultRepo->countConsults(), 'group_count' => $groupRepo->countGroups(), - 'order_count' => $orderRepo->countOrders(), + 'vip_count' => $userRepo->countVipUsers(), 'package_count' => $packageRepo->countPackages(), 'review_count' => $reviewRepo->countReviews(), 'topic_count' => $topicRepo->countTopics(), diff --git a/app/Caches/SiteTodayStat.php b/app/Caches/SiteTodayStat.php index 13c0ae66..53f845c2 100644 --- a/app/Caches/SiteTodayStat.php +++ b/app/Caches/SiteTodayStat.php @@ -7,7 +7,7 @@ use App\Repos\Stat as StatRepo; class SiteTodayStat extends Cache { - protected $lifetime = 1 * 3600; + protected $lifetime = 15 * 60; public function getLifetime() { @@ -26,15 +26,19 @@ class SiteTodayStat extends Cache $date = date('Y-m-d'); $saleCount = $statRepo->countDailySales($date); + $refundCount = $statRepo->countDailyRefunds($date); $saleAmount = $statRepo->sumDailySales($date); $refundAmount = $statRepo->sumDailyRefunds($date); - $registerCount = $statRepo->countDailyRegisteredUser($date); + $registerCount = $statRepo->countDailyRegisteredUsers($date); + $pointRedeemCount = $statRepo->countDailyPointRedeems($date); return [ 'sale_count' => $saleCount, + 'refund_count' => $refundCount, 'sale_amount' => $saleAmount, 'refund_amount' => $refundAmount, 'register_count' => $registerCount, + 'point_redeem_count' => $pointRedeemCount, ]; } diff --git a/app/Console/Tasks/DeliverTask.php b/app/Console/Tasks/DeliverTask.php index 7c57b30d..e6505c09 100644 --- a/app/Console/Tasks/DeliverTask.php +++ b/app/Console/Tasks/DeliverTask.php @@ -14,7 +14,7 @@ use App\Repos\ImGroupUser as ImGroupUserRepo; use App\Repos\Order as OrderRepo; use App\Repos\User as UserRepo; use App\Services\Logic\Notice\OrderFinish as OrderFinishNotice; -use App\Services\Logic\Point\PointHistory as PointHistoryService; +use App\Services\Logic\Point\History\OrderConsume as OrderConsumePointHistory; use Phalcon\Mvc\Model; use Phalcon\Mvc\Model\Resultset; use Phalcon\Mvc\Model\ResultsetInterface; @@ -205,9 +205,9 @@ class DeliverTask extends Task protected function handleOrderConsumePoint(OrderModel $order) { - $service = new PointHistoryService(); + $service = new OrderConsumePointHistory(); - $service->handleOrderConsume($order); + $service->handle($order); } protected function handleOrderFinishNotice(OrderModel $order) diff --git a/app/Console/Tasks/PointGiftDeliverTask.php b/app/Console/Tasks/PointGiftDeliverTask.php index 0f0778ab..e7f67354 100644 --- a/app/Console/Tasks/PointGiftDeliverTask.php +++ b/app/Console/Tasks/PointGiftDeliverTask.php @@ -14,7 +14,7 @@ use App\Repos\ImGroupUser as ImGroupUserRepo; use App\Repos\PointGift as PointGiftRepo; use App\Repos\PointRedeem as PointRedeemRepo; use App\Services\Logic\Notice\DingTalk\PointRedeem as PointRedeemNotice; -use App\Services\Logic\Point\PointHistory as PointHistoryService; +use App\Services\Logic\Point\History\PointRefund as PointRefundPointHistory; use Phalcon\Mvc\Model\Resultset; use Phalcon\Mvc\Model\ResultsetInterface; @@ -54,9 +54,6 @@ class PointGiftDeliverTask extends Task case PointGiftModel::TYPE_GOODS: $this->handleGoodsRedeem($redeem); break; - case PointGiftModel::TYPE_CASH: - $this->handleCashRedeem($redeem); - break; } $task->status = TaskModel::STATUS_FINISHED; @@ -169,16 +166,11 @@ class PointGiftDeliverTask extends Task $notice->createTask($redeem); } - protected function handleCashRedeem(PointRedeemModel $redeem) - { - - } - protected function handlePointRefund(PointRedeemModel $redeem) { - $service = new PointHistoryService(); + $service = new PointRefundPointHistory(); - $service->handlePointRefund($redeem); + $service->handle($redeem); } /** diff --git a/app/Console/Tasks/SyncLearningTask.php b/app/Console/Tasks/SyncLearningTask.php index 2ba7a0e8..f4845a3d 100644 --- a/app/Console/Tasks/SyncLearningTask.php +++ b/app/Console/Tasks/SyncLearningTask.php @@ -10,7 +10,7 @@ use App\Repos\ChapterUser as ChapterUserRepo; use App\Repos\Course as CourseRepo; use App\Repos\CourseUser as CourseUserRepo; use App\Repos\Learning as LearningRepo; -use App\Services\Logic\Point\PointHistory as PointHistoryService; +use App\Services\Logic\Point\History\ChapterStudy as ChapterStudyPointHistory; use App\Services\Sync\Learning as LearningSyncService; class SyncLearningTask extends Task @@ -184,9 +184,9 @@ class SyncLearningTask extends Task */ protected function handleStudyPoint(ChapterUserModel $chapterUser) { - $service = new PointHistoryService(); + $service = new ChapterStudyPointHistory(); - $service->handleChapterStudy($chapterUser); + $service->handle($chapterUser); } } diff --git a/app/Http/Admin/Controllers/ArticleController.php b/app/Http/Admin/Controllers/ArticleController.php index 14a3b3af..7fd4a3b4 100644 --- a/app/Http/Admin/Controllers/ArticleController.php +++ b/app/Http/Admin/Controllers/ArticleController.php @@ -31,10 +31,12 @@ class ArticleController extends Controller { $articleService = new ArticleService(); + $publishTypes = $articleService->getPublishTypes(); $sourceTypes = $articleService->getSourceTypes(); $categories = $articleService->getCategories(); $xmTags = $articleService->getXmTags(0); + $this->view->setVar('publish_types', $publishTypes); $this->view->setVar('source_types', $sourceTypes); $this->view->setVar('categories', $categories); $this->view->setVar('xm_tags', $xmTags); @@ -52,6 +54,19 @@ class ArticleController extends Controller $this->view->setVar('pager', $pager); } + /** + * @Get("/list/pending", name="admin.article.pending_list") + */ + public function pendingListAction() + { + $articleService = new ArticleService(); + + $pager = $articleService->getPendingArticles(); + + $this->view->pick('article/pending_list'); + $this->view->setVar('pager', $pager); + } + /** * @Get("/add", name="admin.article.add") */ @@ -64,6 +79,40 @@ class ArticleController extends Controller $this->view->setVar('categories', $categories); } + /** + * @Get("/{id:[0-9]+}/edit", name="admin.article.edit") + */ + public function editAction($id) + { + $articleService = new ArticleService(); + + $publishTypes = $articleService->getPublishTypes(); + $sourceTypes = $articleService->getSourceTypes(); + $categories = $articleService->getCategories(); + $article = $articleService->getArticle($id); + $xmTags = $articleService->getXmTags($id); + + $this->view->setVar('publish_types', $publishTypes); + $this->view->setVar('source_types', $sourceTypes); + $this->view->setVar('categories', $categories); + $this->view->setVar('article', $article); + $this->view->setVar('xm_tags', $xmTags); + } + + /** + * @Get("/{id:[0-9]+}/show", name="admin.article.show") + */ + public function showAction($id) + { + $articleService = new ArticleService(); + + $rejectOptions = $articleService->getRejectOptions(); + $article = $articleService->getArticle($id); + + $this->view->setVar('reject_options', $rejectOptions); + $this->view->setVar('article', $article); + } + /** * @Post("/create", name="admin.article.create") */ @@ -86,24 +135,6 @@ class ArticleController extends Controller return $this->jsonSuccess($content); } - /** - * @Get("/{id:[0-9]+}/edit", name="admin.article.edit") - */ - public function editAction($id) - { - $articleService = new ArticleService(); - - $sourceTypes = $articleService->getSourceTypes(); - $categories = $articleService->getCategories(); - $article = $articleService->getArticle($id); - $xmTags = $articleService->getXmTags($id); - - $this->view->setVar('source_types', $sourceTypes); - $this->view->setVar('categories', $categories); - $this->view->setVar('article', $article); - $this->view->setVar('xm_tags', $xmTags); - } - /** * @Post("/{id:[0-9]+}/update", name="admin.article.update") */ @@ -152,4 +183,23 @@ class ArticleController extends Controller return $this->jsonSuccess($content); } + /** + * @Post("/{id:[0-9]+}/review", name="admin.article.review") + */ + public function reviewAction($id) + { + $articleService = new ArticleService(); + + $articleService->reviewArticle($id); + + $location = $this->url->get(['for' => 'admin.article.pending_list']); + + $content = [ + 'location' => $location, + 'msg' => '审核文章成功', + ]; + + return $this->jsonSuccess($content); + } + } diff --git a/app/Http/Admin/Controllers/IndexController.php b/app/Http/Admin/Controllers/IndexController.php index c5ff04b4..72e5071b 100644 --- a/app/Http/Admin/Controllers/IndexController.php +++ b/app/Http/Admin/Controllers/IndexController.php @@ -37,11 +37,13 @@ class IndexController extends Controller $globalStat = $indexService->getGlobalStat(); $todayStat = $indexService->getTodayStat(); + $modStat = $indexService->getModerationStat(); $appInfo = $indexService->getAppInfo(); $serverInfo = $indexService->getServerInfo(); $this->view->setVar('global_stat', $globalStat); $this->view->setVar('today_stat', $todayStat); + $this->view->setVar('mod_stat', $modStat); $this->view->setVar('app_info', $appInfo); $this->view->setVar('server_info', $serverInfo); } diff --git a/app/Http/Admin/Controllers/ModerationController.php b/app/Http/Admin/Controllers/ModerationController.php new file mode 100644 index 00000000..75c81808 --- /dev/null +++ b/app/Http/Admin/Controllers/ModerationController.php @@ -0,0 +1,25 @@ +getArticles(); + + $this->view->setVar('pager', $pager); + } + +} diff --git a/app/Http/Admin/Services/Article.php b/app/Http/Admin/Services/Article.php index 8c4dabdd..98674a74 100644 --- a/app/Http/Admin/Services/Article.php +++ b/app/Http/Admin/Services/Article.php @@ -9,16 +9,31 @@ use App\Library\Utils\Word as WordUtil; use App\Models\Article as ArticleModel; use App\Models\ArticleTag as ArticleTagModel; use App\Models\Category as CategoryModel; +use App\Models\Reason as ReasonModel; +use App\Models\User as UserModel; use App\Repos\Article as ArticleRepo; use App\Repos\ArticleTag as ArticleTagRepo; use App\Repos\Category as CategoryRepo; use App\Repos\Tag as TagRepo; +use App\Repos\User as UserRepo; +use App\Services\Logic\Notice\System\ArticleApproved as ArticleApprovedNotice; +use App\Services\Logic\Notice\System\ArticleRejected as ArticleRejectedNotice; +use App\Services\Logic\Point\History\ArticlePost as ArticlePostPointHistory; use App\Services\Sync\ArticleIndex as ArticleIndexSync; use App\Validators\Article as ArticleValidator; class Article extends Service { + public function getArticleModel() + { + $article = new ArticleModel(); + + $article->afterFetch(); + + return $article; + } + public function getXmTags($id) { $tagRepo = new TagRepo(); @@ -61,11 +76,21 @@ class Article extends Service ]); } + public function getPublishTypes() + { + return ArticleModel::publishTypes(); + } + public function getSourceTypes() { return ArticleModel::sourceTypes(); } + public function getRejectOptions() + { + return ReasonModel::articleRejectOptions(); + } + public function getArticles() { $pagerQuery = new PagerQuery(); @@ -98,7 +123,7 @@ class Article extends Service { $post = $this->request->getPost(); - $loginUser = $this->getLoginUser(); + $user = $this->getLoginUser(); $validator = new ArticleValidator(); @@ -107,12 +132,16 @@ class Article extends Service $article = new ArticleModel(); - $article->owner_id = $loginUser->id; + $article->owner_id = $user->id; $article->category_id = $category->id; $article->title = $title; $article->create(); + $this->incrUserArticleCount($user); + + $this->eventsManager->fire('Article:afterCreate', $this, $article); + return $article; } @@ -159,6 +188,10 @@ class Article extends Service $data['allow_comment'] = $post['allow_comment']; } + if (isset($post['private'])) { + $data['private'] = $validator->checkPrivateStatus($post['private']); + } + if (isset($post['featured'])) { $data['featured'] = $validator->checkFeatureStatus($post['featured']); } @@ -173,24 +206,99 @@ class Article extends Service $article->update($data); + $this->rebuildArticleIndex($article); + + $this->eventsManager->fire('Article:afterUpdate', $this, $article); + return $article; } public function deleteArticle($id) { $article = $this->findOrFail($id); + $article->deleted = 1; + $article->update(); + $userRepo = new UserRepo(); + + $owner = $userRepo->findById($article->owner_id); + + $this->decrUserArticleCount($owner); + + $this->rebuildArticleIndex($article); + + $this->eventsManager->fire('Article:afterDelete', $this, $article); + return $article; } public function restoreArticle($id) { $article = $this->findOrFail($id); + $article->deleted = 0; + $article->update(); + $userRepo = new UserRepo(); + + $owner = $userRepo->findById($article->owner_id); + + $this->incrUserArticleCount($owner); + + $this->rebuildArticleIndex($article); + + $this->eventsManager->fire('Article:afterRestore', $this, $article); + + return $article; + } + + public function reviewArticle($id) + { + $type = $this->request->getPost('type', ['trim', 'string']); + $reason = $this->request->getPost('reason', ['trim', 'string']); + + $article = $this->findOrFail($id); + + if ($type == 'approve') { + $article->published = ArticleModel::PUBLISH_APPROVED; + } elseif ($type == 'reject') { + $article->published = ArticleModel::PUBLISH_REJECTED; + } + + $article->update(); + + $sender = $this->getLoginUser(); + + if ($type == 'approve') { + + $this->rebuildArticleIndex($article); + + $this->handlePostPoint($article); + + $notice = new ArticleApprovedNotice(); + + $notice->handle($article, $sender); + + $this->eventsManager->fire('Article:afterApprove', $this, $article); + + } elseif ($type == 'reject') { + + $options = ReasonModel::articleRejectOptions(); + + if (array_key_exists($reason, $options)) { + $reason = $options[$reason]; + } + + $notice = new ArticleRejectedNotice(); + + $notice->handle($article, $sender, $reason); + + $this->eventsManager->fire('Article:afterReject', $this, $article); + } + return $article; } @@ -201,24 +309,15 @@ class Article extends Service return $validator->checkArticle($id); } - protected function rebuildArticleCache(ArticleModel $article) - { - $cache = new ArticleCache(); - - $cache->rebuild($article->id); - } - - protected function rebuildArticleIndex(ArticleModel $article) - { - $sync = new ArticleIndexSync(); - - $sync->addItem($article->id); - } - protected function saveTags(ArticleModel $article, $tagIds) { $originTagIds = []; + /** + * 修改数据后,afterFetch设置的属性会失效,重新执行 + */ + $article->afterFetch(); + if ($article->tags) { $originTagIds = kg_array_column($article->tags, 'id'); } @@ -284,4 +383,42 @@ class Article extends Service return $pager; } + protected function incrUserArticleCount(UserModel $user) + { + $user->article_count += 1; + + $user->update(); + } + + protected function decrUserArticleCount(UserModel $user) + { + if ($user->article_count > 0) { + $user->article_count -= 1; + $user->update(); + } + } + + protected function rebuildArticleCache(ArticleModel $article) + { + $cache = new ArticleCache(); + + $cache->rebuild($article->id); + } + + protected function rebuildArticleIndex(ArticleModel $article) + { + $sync = new ArticleIndexSync(); + + $sync->addItem($article->id); + } + + protected function handlePostPoint(ArticleModel $article) + { + if ($article->published != ArticleModel::PUBLISH_APPROVED) return; + + $service = new ArticlePostPointHistory(); + + $service->handle($article); + } + } diff --git a/app/Http/Admin/Services/AuthNode.php b/app/Http/Admin/Services/AuthNode.php index 4e260dc9..1c7871e3 100644 --- a/app/Http/Admin/Services/AuthNode.php +++ b/app/Http/Admin/Services/AuthNode.php @@ -140,36 +140,36 @@ class AuthNode extends Service ], [ 'id' => '1-4', - 'title' => '话题管理', + 'title' => '专题管理', 'type' => 'menu', 'children' => [ [ 'id' => '1-4-1', - 'title' => '话题列表', + 'title' => '专题列表', 'type' => 'menu', 'route' => 'admin.topic.list', ], [ 'id' => '1-4-5', - 'title' => '搜索话题', + 'title' => '搜索专题', 'type' => 'menu', 'route' => 'admin.topic.search', ], [ 'id' => '1-4-2', - 'title' => '添加话题', + 'title' => '添加专题', 'type' => 'menu', 'route' => 'admin.topic.add', ], [ 'id' => '1-4-3', - 'title' => '编辑话题', + 'title' => '编辑专题', 'type' => 'button', 'route' => 'admin.topic.edit', ], [ 'id' => '1-4-4', - 'title' => '删除话题', + 'title' => '删除专题', 'type' => 'button', 'route' => 'admin.topic.delete', ], @@ -272,6 +272,12 @@ class AuthNode extends Service 'type' => 'button', 'route' => 'admin.article.edit', ], + [ + 'id' => '1-7-6', + 'title' => '文章分类', + 'type' => 'menu', + 'route' => 'admin.article.category', + ], [ 'id' => '1-7-5', 'title' => '删除文章', @@ -279,10 +285,16 @@ class AuthNode extends Service 'route' => 'admin.article.delete', ], [ - 'id' => '1-7-6', - 'title' => '文章分类', - 'type' => 'menu', - 'route' => 'admin.article.category', + 'id' => '1-7-9', + 'title' => '文章详情', + 'type' => 'button', + 'route' => 'admin.article.review', + ], + [ + 'id' => '1-7-10', + 'title' => '审核文章', + 'type' => 'button', + 'route' => 'admin.article.review', ], ], ], @@ -364,6 +376,19 @@ class AuthNode extends Service 'id' => '2', 'title' => '运营管理', 'children' => [ + [ + 'id' => '2-10', + 'title' => '审核队列', + 'type' => 'menu', + 'children' => [ + [ + 'id' => '2-10-1', + 'title' => '文章列表', + 'type' => 'menu', + 'route' => 'admin.mod.articles', + ], + ], + ], [ 'id' => '2-1', 'title' => '学员管理', diff --git a/app/Http/Admin/Services/Index.php b/app/Http/Admin/Services/Index.php index b67928c3..bb529fb8 100644 --- a/app/Http/Admin/Services/Index.php +++ b/app/Http/Admin/Services/Index.php @@ -2,6 +2,7 @@ namespace App\Http\Admin\Services; +use App\Caches\ModerationStat; use App\Caches\SiteGlobalStat; use App\Caches\SiteTodayStat; use App\Library\AppInfo; @@ -53,6 +54,13 @@ class Index extends Service return $cache->get(); } + public function getModerationStat() + { + $cache = new ModerationStat(); + + return $cache->get(); + } + public function getReleases() { $url = 'https://koogua.com/api-releases.json'; diff --git a/app/Http/Admin/Services/Moderation.php b/app/Http/Admin/Services/Moderation.php new file mode 100644 index 00000000..68b69cc0 --- /dev/null +++ b/app/Http/Admin/Services/Moderation.php @@ -0,0 +1,52 @@ +getParams(); + + $params['published'] = ArticleModel::PUBLISH_PENDING; + $params['deleted'] = 0; + + $sort = $pagerQuery->getSort(); + $page = $pagerQuery->getPage(); + $limit = $pagerQuery->getLimit(); + + $articleRepo = new ArticleRepo(); + + $pager = $articleRepo->paginate($params, $sort, $page, $limit); + + return $this->handleArticles($pager); + } + + protected function handleArticles($pager) + { + if ($pager->total_items > 0) { + + $builder = new ArticleListBuilder(); + + $items = $pager->items->toArray(); + + $pipeA = $builder->handleArticles($items); + $pipeB = $builder->handleCategories($pipeA); + $pipeC = $builder->handleUsers($pipeB); + $pipeD = $builder->objects($pipeC); + + $pager->items = $pipeD; + } + + return $pager; + } + +} diff --git a/app/Http/Admin/Views/article/edit_basic.volt b/app/Http/Admin/Views/article/edit_basic.volt index 70d75e4a..8857b583 100644 --- a/app/Http/Admin/Views/article/edit_basic.volt +++ b/app/Http/Admin/Views/article/edit_basic.volt @@ -50,6 +50,14 @@ +
文章 | +作者 | +来源 | +评论 | +时间 | +操作 | +
---|---|---|---|---|---|
+ 标题:{{ item.title }}({{ item.id }}) + + |
+
+
+ 编号:{{ item.owner.id }} + |
+ {{ source_info(item.source_type,item.source_url) }} | ++ {% if item.allow_comment == 1 %} + 开启 + {% else %} + 关闭 + {% endif %} + | ++ {% if item.update_time > 0 %} + {{ date('Y-m-d H:i:s',item.update_time) }} + {% else %} + {{ date('Y-m-d H:i:s',item.create_time) }} + {% endif %} + | ++ 详情 + | +