12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace app\index\controller;
- use app\index\model\CommonModel;
- use app\index\model\ColumnModel;
- use app\index\controller\Base;
- class Index extends Base
- {
-
- public function index()//主页
- {
- $cum = new ColumnModel();//导航栏表
- $com = new CommonModel();//工具信息表
- // $cums = $cum->select();
- $column_id=input('column_id');
- //查询当前导航栏表名称
- $cid=$cum->find($column_id);
- //查询当前工具信息表下的信息
- $goods=$com->where(array('column_id'=>$column_id))->order('sort desc')->select();
-
- $this->assign([
- 'goods'=>$goods,
- 'cid'=>$cid,
- ]);
-
- return view();
-
-
- }
- public function title(){
- $id = input('id');
- $titles = db('good')->where('id',$id)->find();
-
- $this->assign([
- 'titles'=>$titles,
- ]);
- return view($titles['url']);
- }
-
-
-
- }
|