TP链式操作在group的情况下怎么count

zxc7744574 1年前 ⋅ 780 阅读

$list['list'] = $this->join('LEFT JOIN dby_domain ON dby_hospital.id = dby_domain.target_id')->where($where)->group('dby_hospital.id')->select();
$sql = $this->join('LEFT JOIN dby_domain ON dby_hospital.id = dby_domain.target_id')->where($where)->group('dby_hospital.id')->field('count(*)')->buildsql();
$list['num'] = D()->table("{$sql} as t")->count();
return $list;


全部评论: 0

    我有话说: