上一篇我们提到: 使用pb时发现标题这块逻辑不太符合常用的效果,默认的是后台有站点标题和副标题,在前台的展示方式是:1、太阳成tyc7111cc集团:站点标题-副标题2、列表页:栏目标题-站点标题-副标题3、详情页:文章标题-站点标题-副标题4、单页:文章标题-站点标题-副标题和平时其他cms使用对比,问题就出现在这个副标题,这个其实类似企业定位语,一般对
接下来我们进入今天的正文:修改appsdminmodelcontentormmodel.html 增加
// pbootcms二开网站建设自定义表单增加搜索字段查找
public function findFormField($table, $page, $type, $keyword)
{
return parent::table($table)
->like($type, $keyword)
->order('id ASC')
->decode(false)
->page($page)
->select();
}
// 全部字段查找
public function findFormFieldAll($table, $page, $typeall, $keyword)
{
return parent::table($table)
->like($typeall, $keyword)
->order('id ASC')
->decode(false)
->page($page)
->select();
}
修改appsdmincontrollercontentormcontroller.html
文件开始的注释 //自定义表单列表 下内容为
// 自定义表单列表
public function index()
{
if ((! ! $fcode = get('fcode', 'var')) && $form = $this->model->getFormByCode($fcode)) {
$this->assign('form', $form);
if (get('action') == 'showdata') {
$this->assign('showdata', true);
$this->assign('fields', $this->model->getFormFieldByCode($fcode)); // 获取字段
$table = $this->model->getFormTableByCode($fcode);
//查找
if (get('keyword')) {
if ($type = get('type')) {
$result = $this->model->findFormField($table, true, get('type'), get('keyword'));
} else {
$fields = $this->model->getFormFieldByCode($fcode);
foreach ($fields as $key => $value) {
$typeall = $value->name.','.$typeall;
}
$typeall = substr($typeall, 0, strlen($typeall)-1);
$result = $this->model->findFormFieldAll($table, true, $typeall, get('keyword'));
}
$this->assign('formdata', $result);
} elseif (get('export')) {
$this->assign('formdata', $this->model->getFormData($table, false));
header('Content-Type:application/vnd.ms-excel');
header('Cache-Control: max-age=0');
header("Content-Disposition:filename=" . $form->form_name . "-" . date("YmdHis") . ".xls");
$this->display('content/exform.html');
} else {
$this->assign('formdata', $this->model->getFormData($table, true));
}
}
if (get('action') == 'showfield') {
$this->assign('showfield', true);
$this->assign('fields', $this->model->getFormFieldByCode($fcode));
}
} else {
$this->assign('list', true);
if (! ! ($field = get('field', 'var')) && ! ! ($keyword = get('keyword', 'vars'))) {
$result = $this->model->findForm($field, $keyword);
} else {
$result = $this->model->getList();
}
$this->assign('forms', $result);
}
$this->display('content/form.html');
}
修改 ppsdminiewdefaultcontentorm.html 文件 大概 81行
{if([$showdata])} {if}中间内容替换为
以上代码 修改于成都网站建设四川冠辰科技整理发布pbootcms二开网站建设自定义表单增加搜索
扫一扫,浏览关注本文
版权所有 Copyright © 2007-2024 太阳成tyc7111cc集团 川公安网备案:51010602001006号
地址:太阳成tyc7111cc集团 蜀ICP备11012605号-1
始于2007年,十五年品牌网站建设,值得信赖!