application/admin/controller/Search.php
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?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;
class Search extends Base
{
private $searchword_db;
public function _initialize() {
parent::_initialize();
$this->searchword_db = Db::name('search_word');
}
/**
* 搜索主页
*/
public function index()
{
$list = array();
$param = input('param.');
$keywords = input('keywords/s');
$keywords = trim($keywords);
$condition = [];
foreach (['keywords'] as $key) {
if (isset($param[$key]) && $param[$key] !== '') {
if ($key == 'keywords') {
$condition['word'] = array('LIKE', "%{$keywords}%");
} else {
$condition[''.$key] = array('eq', trim($param[$key]));
}
}
}
$condition['lang'] = array('eq', $this->admin_lang);
$count = $this->searchword_db->where($condition)->count('id');
$Page = $pager = new Page($count, config('paginate.list_rows'));
$list = $this->searchword_db->where($condition)->order('id desc')->limit($Page->firstRow.','.$Page->listRows)->select();
$show = $Page->show();
$this->assign('page',$show);
$this->assign('list',$list);
$this->assign('pager',$pager);
return $this->fetch();
}
后面还有 71 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
