我正在运行一个查询,其中$sale_ids可能包含100到数千个sale_ids.我正在寻找一种方法来修复正则表达式错误,而无需修改CI 3的核心.
原文链接:https://www.f2er.com/regex/356719.html这在版本2中没有发生,并且不被认为是CI 3中的错误(我之前提出过这个问题).
我有办法让这个工作吗?我可以改变应用程序的逻辑,但这需要几天的工作.
我正在寻找一种方法来扩展/覆盖一个类,所以我可以允许这个查询工作如果没有办法通过覆盖这样做我将不得不破解核心(我不知道如何).
$this->db->select('sales_payments.*,sales.sale_time'); $this->db->from('sales_payments'); $this->db->join('sales','sales.sale_id=sales_payments.sale_id'); $this->db->where_in('sales_payments.sale_id',$sale_ids); $this->db->order_by('payment_date');
错误是:
Severity: Warning Message: preg_match(): Compilation Failed: regular expression is too large at offset 53249 Filename: database/DB_query_builder.PHP Line Number: 2354 Backtrace: File: /Applications/MAMP/htdocs/PHPpos/PHP-Point-Of-Sale/application/models/Sale.PHP Line: 123 Function: get File: /Applications/MAMP/htdocs/PHPpos/PHP-Point-Of-Sale/application/models/Sale.PHP Line: 48 Function: _get_all_sale_payments File: /Applications/MAMP/htdocs/PHPpos/PHP-Point-Of-Sale/application/models/reports/Summary_payments.PHP Line: 60 Function: get_payment_data File: /Applications/MAMP/htdocs/PHPpos/PHP-Point-Of-Sale/application/controllers/Reports.PHP Line: 1887 Function: getData File: /Applications/MAMP/htdocs/PHPpos/PHP-Point-Of-Sale/index.PHP Line: 323 Function: require_once