首页 > 其他 > 详细

phalcon count统计

时间:2016-09-16 11:33:57      阅读:951      评论:0      收藏:0      [点我收藏+]

单表count:

//How many robots are there?
$number = Robots::count();
echo "There are ", $number, "\n";

//How many mechanical robots are there?
$number = Robots::count("type=‘mechanical‘");
echo "There are ", $number, " mechanical robots\n"

 

多表count:

$result = $this->modelsManager->createBuilder()
->columns("SysContractWarn.con_warn_id")
->from("SysCustomer")
->join("SysContract","SysCustomer.cus_id = SysContract.cus_id")
->join("SysContractWarn","SysContract.con_id = SysContractWarn.con_id")
->where($where." AND SysCustomer.serv_status = 0 AND SysContractWarn.rmk_del = 0",array("manId"=>$man->man_id))
->getQuery()
->execute()
->count();

phalcon count统计

原文:http://www.cnblogs.com/achengmu/p/5876086.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!