修复前端数据库报错

This commit is contained in:
2025-05-19 16:04:45 +08:00
parent 41a2d69f22
commit 1587524031
11 changed files with 47 additions and 55 deletions
+6 -6
View File
@@ -10,9 +10,9 @@ use think\facade\Env;
use think\facade\Config;
use app\index\model\Banner;
use app\index\model\ResourcesCategory;
use app\index\model\ArticleCategory;
use app\index\model\ArticlesCategory;
use app\index\model\Resources;
use app\index\model\Article;
use app\index\model\Articles;
class Index extends Base
@@ -38,7 +38,7 @@ class Index extends Base
public function siteNewslist()
{
// 获取站点资讯分类(顶级分类id为1的子分类)
$categories = ArticleCategory::where('cid', 1)
$categories = ArticlesCategory::where('cid', 1)
->where('delete_time', null)
->select()
->toArray();
@@ -54,7 +54,7 @@ class Index extends Base
];
// 获取该分类下的文章,限制4条
$articles = Article::where('cate', $category['id'])
$articles = Articles::where('cate', $category['id'])
->where('delete_time', null)
->where('status', 2)
->order('id', 'desc')
@@ -79,7 +79,7 @@ class Index extends Base
public function technicalArticleslist()
{
// 获取技术文章分类(顶级分类id为3的子分类)
$categories = ArticleCategory::where('cid', 3)
$categories = ArticlesCategory::where('cid', 3)
->where('delete_time', null)
->select()
->toArray();
@@ -97,7 +97,7 @@ class Index extends Base
$categoryImageMap[$category['id']] = $category['image'] ?? '';
// 获取每个分类下的文章,限制12条
$articles = Article::where('cate', $category['id'])
$articles = Articles::where('cate', $category['id'])
->where('delete_time', null)
->where('status', 2)
->order('id', 'desc')