1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
-
-
- namespace app\admin\controller;
-
- use think\Db;
- use think\Page;
- use think\Cache;
-
- class ArchivesFlag extends Base
- {
- public function index()
- {
- $list = array();
- $keywords = input('keywords/s');
- $keywords = addslashes(trim($keywords));
-
- $condition = array();
- if (!empty($keywords)) {
- $condition['flag_name'] = array('LIKE', "%{$keywords}%");
- }
-
- $archivesflagM = Db::name('archives_flag');
- $count = $archivesflagM->where($condition)->count('id');
- $Page = $pager = new Page($count, config('paginate.list_rows'));
- $list = $archivesflagM->where($condition)->order('sort_order asc, id asc')->limit($Page->firstRow.','.$Page->listRows)->select();
-
- $show = $Page->show();
- $this->assign('page',$show);
- $this->assign('list',$list);
- $this->assign('pager',$pager);
- return $this->fetch();
- }
- }
|