nangge / noneCms

基于thinkphp5.1 的内容管理系统,可快速搭建博客、企业站;并且增加了实时聊天室
http://www.5none.com
Other
273 stars 120 forks source link

bug #10

Open x12311231 opened 7 years ago

x12311231 commented 7 years ago

文件位置: application\common\taglib\Tag.php 问题: 条件:where status = 0 and cid = 13 or cid in (2,3,4)(当分类为子类时无法隐藏删除) 应改为:where status = 0 and cid = 13 or cid in (2,3,4) and status = 0;(不知如何用tp5连续操作表达) 所以改为一级分类不能添加文章,二级才能添加文章,也有利于站点结构 修改为: ` /**

nangge commented 7 years ago

已修复

logofun commented 7 years ago

还是抛出一个问题 [1] ErrorException in 16f8c6af2aeb74e99e4e6a878e7428db.php line 132

Call to undefined function array_column()

            /*存在子类,则获取子类下的文章*/
            if($cid){
                $condition['cid'] = $cid;
                $children_ids = think\Db::name('category')->field('id')->where('pid',$condition['cid'])->select();
                $children_ids = array_column($children_ids,'id');   /***## 出错在这一行***/
            }
            $list = think\Db::name('article')->where($condition);
            if(isset($children_ids) && $children_ids){
                 $list = $list->whereor('cid','in',$children_ids);
             }

            if("" != ''){
                $list=$list->field("");
            }

分析原因是PHP版本低于5.5的原因。nangge大是否应该做下兼容啊。 http://www.thinkphp.cn/code/335.html

p270228163 commented 6 years ago

已修复

为什么是js 分类, 而不是放到php 分类里面呢