public function lists()
{
if ($this->request->isAjax()) { //
$get = $this->request->get();
$lists = ArticleLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view('', [
'category' => ArticleCategoryLogic::getCategory()
]);
}
autoload2022-07-21 16:16:49
The general understanding is: determine whether the request is Ajax. If so, use the static method lists of ArticleLogic to obtain the value in the database that matches the parameters in the get request, and return the returned value. If not, return a view. Of course Contains the value of the category parameter