postData(); $where[] = ['is_delete', '=', 0]; // 列表 $list = $model->getList($postData, $this->getBranchId()); // 待审核数量 $num = $model->getStatusNum($where, $this->getBranchId()); return $this->renderSuccess('', compact('list', 'num')); } /** * 评论详情 */ public function detail($comment_id) { $data = CommentModel::detail($comment_id, ['user', 'activity', 'images.file']); return $this->renderSuccess('', compact('data')); } /** * 更新评论 */ public function edit($comment_id) { $model = CommentModel::detail($comment_id); if ($model->editComment($this->postData())) { return $this->renderSuccess('修改成功'); } return $this->renderError('修改失败'); } /** * 删除评论 */ public function delete($comment_id) { $model = new CommentModel(); if (!$model->setDelete($comment_id)) { return $this->renderError('删除失败'); } return $this->renderSuccess('删除成功'); } }