gpt4 book ai didi

cakephp - 蛋糕 php 计数不同

转载 作者:可可西里 更新时间:2023-11-01 09:00:29 28 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/44852660/

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