gpt4 book ai didi

php - 错误: Call to undefined function SUM()

转载 作者:行者123 更新时间:2023-11-29 06:47:55 25 4
gpt4 key购买 nike

使用cakephp2

$total = $this->order->find('all', array(
'fields' => array(SUM(order.vat)),
'conditions' => $condition
));

SUM 函数对我不起作用,出现错误:

Call to undefined function SUM()

最佳答案

你需要这样写,

$total = $this->order->find('all',array(
'fields'=>array('SUM(order.vat) as total_vat'),
'conditions'=>$condition
));

SUM(order.vat) 周围添加引号。

关于php - 错误: Call to undefined function SUM(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48636337/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com