pbootcms后台列表加入自定义字段,模板里面可判断模型
2024-05-24 20:29:23
后台列表加入自定义字段, 先打开 apps/admin/model/content/ContentModel.php
// 获取文章列表 public function getList($mcode, $where = array()) { $field = array( 'a.id', 'b.name as sortname', 'a.scode', 'c.name as subsortname', 'a.subscode', 'a.title', 'a.subtitle', 'a.date', 'a.sorting', 'a.status', 'a.istop', 'a.isrecommend', 'a.isheadline', 'a.visits', 'a.ico', 'a.pics', 'a.filename', 'a.outlink', 'd.urlname', 'b.filename as sortfilename', 'content_ext.ext_orderno'//加入要列表出来得自定义字段 ); $join = array( array( 'ay_content_sort b', 'a.scode=b.scode', 'LEFT' ), array( 'ay_content_sort c', 'a.subscode=c.scode', 'LEFT' ), array( 'ay_model d', 'b.mcode=d.mcode', 'LEFT' ), array('ay_content_ext content_ext', 'a.id=content_ext.contentid', 'LEFT')//这里加入表,自定义字段 和条件 ); return parent::table('ay_content a')->field($field) ->where("b.mcode='$mcode'") ->where('d.type=2 OR d.type is null ') ->where("a.acode='" . session('acode') . "'") ->where($where) ->join($join) ->order('a.sorting ASC,a.id DESC') ->page() ->select(); }
\apps\admin\view\default\content/content.html
然后在模板里面修改,对应表格。加入自定义字段,
<td>[value->ext_orderno]</td>
如果需要判断模型,来显示。
{if(get('mcode')==3)}
<td>[value->ext_orderno]</td>
{/if}
大家自由组合。
【责任编辑:超级管理员】
关键字: pbootcms常见问题
PbootCMSV3.2.5后台增加自定义字段搜索,可搜索标题和其他自定义字段 FFmpeg解决大视频播放卡顿-FFmpeg Batch AV Converte_3.0.5图形软件 设置批量视频转m3u8教程最新文章
2021-05-10 09:29
- pbootcms 上传的图片自动转换webp,达到最佳网站加载速度
- pbootcms模板里面写php判断的方法-判断session
- dede 电脑端和手机端首页同步生成方法,
- excel表格导入access中不换行解决办法-
- dede完美上下篇 英文版替换标签 dede:prenext 中英
- dede中英文网站栏目条调用方法
- dede双语站 面包导航{dede:field name='position'}
- PS: 无法完成请求,因为某种原因阻止文本引擎进行
- dede企业网站常见左侧固定大小类二级菜单调用代码
- 栏目页dede:channelartlist调用下级子类并dede:arcl
- dede:channelartlis 判断是否有子类栏目
- 更换织梦后台图集上传flash插件为layui上传模块
相关文章
2021-05-10 09:29