/** * 选择要查看的业务 */ public function getBusiness() { $host_id = ''; $loginUser = User_Session::getLoginCookie(); $business = $this->getBusinessByUser($loginUser['id']); $hosts = $business['business']; if (!empty($hosts)) { $hosts = substr($hosts, 0, strlen($hosts) - 1); $sql = "select id from `{$this->relationPathTable}` where host in ({$hosts})"; $hosts_ids = self::getIns()->fetchAll($sql, false, true); foreach ($hosts_ids as $value) { $host_id .= $value['id'] . ","; } $host_id = rtrim($host_id, ','); } return $host_id; }