|
@@ -2,6 +2,7 @@
|
|
|
namespace app\index\controller;
|
|
|
use app\index\model\CommonModel;
|
|
|
use app\index\model\ColumnModel;
|
|
|
+use app\index\model\ArticleModel;
|
|
|
use app\index\controller\Base;
|
|
|
class Index extends Base
|
|
|
{
|
|
@@ -45,6 +46,32 @@ class Index extends Base
|
|
|
]);
|
|
|
return view($titles['url']);
|
|
|
}
|
|
|
+
|
|
|
+ public function Homepage(){//文章页和工具页(主页)
|
|
|
+ $aticle = new ArticleModel();//文章表
|
|
|
+ $good = new CommonModel();//工具信息表
|
|
|
+ $gds = $good->alias('a')
|
|
|
+ ->field('a.*,b.catename')
|
|
|
+ ->join('column b','a.column_id=b.id')->limit(8)->order('sort desc')->select();
|
|
|
+ $ar = $aticle->limit(9)->order('time desc')->select();
|
|
|
+ $this->assign([
|
|
|
+ 'ar'=>$ar,
|
|
|
+ 'gds'=>$gds,
|
|
|
+ ]);
|
|
|
+ return view();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public function Artis(){//文章页
|
|
|
+ $aticle = new ArticleModel();//文章表
|
|
|
+ $articles = $aticle->order('time desc')->paginate(15);
|
|
|
+ $this->assign([
|
|
|
+ 'articles'=>$articles,
|
|
|
+ ]);
|
|
|
+ return view();
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|