43 lines
1.6 KiB
PHP
43 lines
1.6 KiB
PHP
<?php
|
|
/**
|
|
* 易优CMS
|
|
* ============================================================================
|
|
* 版权所有 2016-2028 海南赞赞网络科技有限公司,并保留所有权利。
|
|
* 网站地址: http://www.eyoucms.com
|
|
* ----------------------------------------------------------------------------
|
|
* 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
|
|
* ============================================================================
|
|
* Author: 小虎哥 <1105415366@qq.com>
|
|
* Date: 2018-4-3
|
|
*/
|
|
|
|
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');
|
|
|
|
$condition = array();
|
|
if (!empty($keywords)) {
|
|
$condition['flag_name'] = array('LIKE', "%{$keywords}%");
|
|
}
|
|
|
|
$archivesflagM = M('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();
|
|
}
|
|
} |