request->request('page'); $commentList = Comment:: with('archives') ->where(['user_id' => $this->auth->id]) ->order('id desc') ->page($page, 10) ->select(); foreach ($commentList as $index => $item) { $item->create_date = human_date($item->createtime); $item->hidden(['ip', 'useragent', 'deletetime', 'aid', 'subscribe', 'status', 'type', 'updatetime']); } $this->success('', ['commentList' => $commentList]); } /** * 关于我们 */ public function aboutus() { $pageInfo = Page::getByDiyname('aboutus'); if (!$pageInfo || $pageInfo['status'] != 'normal') { $this->error(__('单页未找到')); } $pageInfo->image = cdnurl($pageInfo->image, true); $pageInfo->visible(['id', 'title', 'image', 'content', 'createtime']); $pageInfo = $pageInfo->toArray(); $this->success('', ['pageInfo' => $pageInfo]); } }