单表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();

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2022-02-19
  • 2022-01-23
  • 2021-08-17
  • 2021-08-28
猜你喜欢
  • 2022-01-17
  • 2021-07-16
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案