如何在thinkcmf 中增加一个自定义的字段post_price
如何在thinkcmf 中增加一个自定义的字段post_price
phpmyadmin 进入数据库后台
localhost - sanyahaidiao - cmf_portal_post
portal_post 加个字段 post_price
post_pricevarchar(50)utf8mb4_general_ci是0
wdcp找到后台模板文件
/public/themes/admin_simpleboot3/portal/admin_article
修改add.html
在文章来源下加
<tr>
<th>价格</th>
<td><input class="form-control" type="text" name="post[post_price]" id="source" value=""
placeholder="请输入价格"></td>
</tr>
修改edit.html
在文章来源下加
<tr>
<th>价格</th>
<td>
<input class="form-control" type="text" name="post[post_price]"
value="{$post['post_price']}" placeholder="请输入价格">
</td>
</tr>
wdcp找到前端模板文件
/public/themes/simpleboot3/portal
index.php修改前端调取代码
<h2 class="title"> <a href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}" title="{$vo.post_title}">{$vo.post_price}</a></h2>