mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-25 04:07:17 +08:00
优化批量删除后的跳转
This commit is contained in:
parent
2195904e65
commit
5f9928593e
@ -20,23 +20,19 @@ class CategoryAllList extends Cache
|
||||
return $this->lifetime;
|
||||
}
|
||||
|
||||
public function getKey($type = null)
|
||||
public function getKey($id = null)
|
||||
{
|
||||
return "category_all_list:{$type}";
|
||||
return "category_all_list:{$id}";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $type
|
||||
* @return array
|
||||
*/
|
||||
public function getContent($type = null)
|
||||
public function getContent($id = null)
|
||||
{
|
||||
/**
|
||||
* @var Resultset $categories
|
||||
*/
|
||||
$categories = CategoryModel::query()
|
||||
->columns(['id', 'parent_id', 'name', 'priority', 'level', 'path'])
|
||||
->where('type = :type:', ['type' => $type])
|
||||
->where('type = :type:', ['type' => $id])
|
||||
->orderBy('level ASC, priority ASC')
|
||||
->execute();
|
||||
|
||||
|
@ -25,10 +25,6 @@ class CategoryList extends Cache
|
||||
return "category_list:{$id}";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $id
|
||||
* @return array
|
||||
*/
|
||||
public function getContent($id = null)
|
||||
{
|
||||
/**
|
||||
|
@ -247,10 +247,8 @@ class AnswerController extends Controller
|
||||
|
||||
$answerService->batchDelete();
|
||||
|
||||
$location = $this->url->get(['for' => 'admin.answer.list']);
|
||||
|
||||
$content = [
|
||||
'location' => $location,
|
||||
'location' => $this->request->getHTTPReferer(),
|
||||
'msg' => '批量删除成功',
|
||||
];
|
||||
|
||||
|
@ -64,11 +64,7 @@ class ArticleController extends Controller
|
||||
*/
|
||||
public function addAction()
|
||||
{
|
||||
$articleService = new ArticleService();
|
||||
|
||||
$categories = $articleService->getCategories();
|
||||
|
||||
$this->view->setVar('categories', $categories);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -257,10 +253,8 @@ class ArticleController extends Controller
|
||||
|
||||
$articleService->batchDelete();
|
||||
|
||||
$location = $this->url->get(['for' => 'admin.mod.articles']);
|
||||
|
||||
$content = [
|
||||
'location' => $location,
|
||||
'location' => $this->request->getHTTPReferer(),
|
||||
'msg' => '批量删除成功',
|
||||
];
|
||||
|
||||
|
@ -167,11 +167,9 @@ class CommentController extends Controller
|
||||
|
||||
$commentService->batchDelete();
|
||||
|
||||
$location = $this->url->get(['for' => 'admin.mod.comments']);
|
||||
|
||||
$content = [
|
||||
'location' => $location,
|
||||
'msg' => '批量审核成功',
|
||||
'location' => $this->request->getHTTPReferer(),
|
||||
'msg' => '批量删除成功',
|
||||
];
|
||||
|
||||
return $this->jsonSuccess($content);
|
||||
|
@ -172,10 +172,8 @@ class ConsultController extends Controller
|
||||
|
||||
$consultService->batchDelete();
|
||||
|
||||
$location = $this->url->get(['for' => 'admin.mod.consults']);
|
||||
|
||||
$content = [
|
||||
'location' => $location,
|
||||
'location' => $this->request->getHTTPReferer(),
|
||||
'msg' => '批量删除成功',
|
||||
];
|
||||
|
||||
|
@ -248,10 +248,8 @@ class QuestionController extends Controller
|
||||
|
||||
$questionService->batchDelete();
|
||||
|
||||
$location = $this->url->get(['for' => 'admin.question.list']);
|
||||
|
||||
$content = [
|
||||
'location' => $location,
|
||||
'location' => $this->request->getHTTPReferer(),
|
||||
'msg' => '批量删除成功',
|
||||
];
|
||||
|
||||
|
@ -174,10 +174,8 @@ class ReviewController extends Controller
|
||||
|
||||
$reviewService->batchDelete();
|
||||
|
||||
$location = $this->url->get(['for' => 'admin.mod.reviews']);
|
||||
|
||||
$content = [
|
||||
'location' => $location,
|
||||
'location' => $this->request->getHTTPReferer(),
|
||||
'msg' => '批量删除成功',
|
||||
];
|
||||
|
||||
|
@ -379,7 +379,7 @@ class Article extends Service
|
||||
|
||||
foreach ($articles as $article) {
|
||||
|
||||
$article->published = ArticleModel::PUBLISH_REJECTED;
|
||||
$article->deleted = 1;
|
||||
$article->update();
|
||||
|
||||
$this->handleArticleDeletedNotice($article, $sender);
|
||||
|
@ -364,7 +364,7 @@ class Question extends Service
|
||||
|
||||
foreach ($questions as $question) {
|
||||
|
||||
$question->published = QuestionModel::PUBLISH_REJECTED;
|
||||
$question->deleted = 1;
|
||||
$question->update();
|
||||
|
||||
$this->handleQuestionDeletedNotice($question, $sender);
|
||||
|
Loading…
x
Reference in New Issue
Block a user