diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 9c77b6f..10e8407 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -9,9 +9,9 @@ use think\facade\View; use think\facade\Env; use think\facade\Config; use app\index\model\Banner; -use app\index\model\ResourceCategory; +use app\index\model\ResourcesCategory; use app\index\model\ArticleCategory; -use app\index\model\Resource; +use app\index\model\Resources; use app\index\model\Article; @@ -145,7 +145,7 @@ class Index extends Base public function resourcesList() { // 获取资源分类(顶级分类id为2的子分类) - $categories = ResourceCategory::where('cid', 2) + $categories = ResourcesCategory::where('cid', 2) ->where('delete_time', null) ->select() ->toArray(); @@ -163,7 +163,7 @@ class Index extends Base $categoryImageMap[$category['id']] = $category['image'] ?? ''; // 获取每个分类下的资源,限制8条 - $resources = Resource::where('cate', $category['id']) + $resources = Resources::where('cate', $category['id']) ->where('delete_time', null) ->where('status', 1) ->order('id', 'desc') @@ -211,7 +211,7 @@ class Index extends Base public function programList() { // 获取程序分类(顶级分类id为4的子分类) - $categories = ResourceCategory::where('cid', 1) + $categories = ResourcesCategory::where('cid', 1) ->where('delete_time', null) ->select() ->toArray(); @@ -229,7 +229,7 @@ class Index extends Base $categoryImageMap[$category['id']] = $category['image'] ?? ''; // 获取每个分类下的程序,限制8条 - $programs = Resource::where('cate', $category['id']) + $programs = Resources::where('cate', $category['id']) ->where('delete_time', null) ->where('status', 1) ->order('id', 'desc') diff --git a/app/index/model/Resource.php b/app/index/model/Resources.php similarity index 64% rename from app/index/model/Resource.php rename to app/index/model/Resources.php index 1aea93d..3500d85 100644 --- a/app/index/model/Resource.php +++ b/app/index/model/Resources.php @@ -3,6 +3,6 @@ namespace app\index\model; use think\Model; -class Resource extends Model +class Resources extends Model { } \ No newline at end of file diff --git a/app/index/model/ResourceCategory.php b/app/index/model/ResourcesCategory.php similarity index 59% rename from app/index/model/ResourceCategory.php rename to app/index/model/ResourcesCategory.php index 2a13004..29fdb2f 100644 --- a/app/index/model/ResourceCategory.php +++ b/app/index/model/ResourcesCategory.php @@ -3,6 +3,6 @@ namespace app\index\model; use think\Model; -class ResourceCategory extends Model +class ResourcesCategory extends Model { } \ No newline at end of file