gpt4 book ai didi

cakephp - 蛋糕 php 计数不同

转载 作者:行者123 更新时间:2023-12-02 21:41:46 27 4
gpt4 key购买 nike

如何使这个 Cakephp 查询能够计算不同的值?

        $matches = $this->Product->find('count', array(
'conditions' => array(
"Product.brand_id" => $brand['Brand']['id'],
'Product.active' => 1

));

最佳答案

类似这样的吗?

$matches = $this->Product->find('count', array(
'fields' => 'DISTINCT Product.brand_id',
'conditions' => array("Product.brand_id" => $brand['Brand']['id'],
'Product.active' => 1)
));

关于cakephp - 蛋糕 php 计数不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20332557/

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