在此持续更新thinkphp3.2.4的bug

浏览:1093 发布日期:2019/02/13 分类:技术分享 关键字: TP3 thinkphp3.2.4 bug
在此持续更新thinkphp3.2.4的bug,希望大家能避坑或者fixed up

1.TP3.2.4 where 不能过滤不存在的字段。但是3.2.3手册却还介绍着可以过滤
在此贴出源码if (isset($options['where']) && is_array($options['where']) && !empty($fields) && !isset($options['join'])) {
            // 对数组查询条件进行字段类型检查
            foreach ($options['where'] as $key => $val) {
                $key = trim($key);
                if (in_array($key, $fields, true)) {
                    if (is_scalar($val)) {
                        $this->_parseType($options['where'], $key);
                    }
                }
            }
        }
        // 查询过后清空sql表达式组装 避免影响下次查询
        $this->options = array();
        // 表达式过滤
        $this->_options_filter($options);
        return $options;
最佳答案
评论( 相关
后面还有条评论,点击查看>>