getPageValue(); $where = ['state' => 'channelCode-' . $channelId, 'user_name' => $name, 'is_del_user' => 0]; $list = $this->dao->getDataList($where, ['createtime as create_time', 'client_id'], $page, $limit, 'create_time', ['client' => function ($query) { $query->field(['id', 'name', 'avatar']); }]); $count = $this->dao->count($where); return compact('list', 'count'); } /** * 获取渠道码客户数量 * @param int $channelId 渠道码ID * @return int */ public function getChannelCodeClientCount($channelId) { return $this->dao->count(['state' => 'channelCode-' . $channelId, 'is_del_user' => 0]) ?? 0; } }