public function deptchange($deptid) { $conn_im = $this->containter->get("we_data_access_im"); if (empty($deptid)) { return; } $dept = new Dept($this->da, $conn_im, $this->containter); $deptinfo = $dept->getinfo(is_string($deptid) ? $deptid : $deptid['dept_id']); $paths = explode('/', $deptinfo["path"]); if (count($paths) == 0) { return; } foreach ($paths as $key => $value) { if (empty($value)) { continue; } $this->updatedeptversion($value); } }
public function RemoveDefaultGroupMember($parameter) { try { $deptid = isset($parameter["deptid"]) ? $parameter["deptid"] : null; if (empty($deptid)) { return false; } $da = $this->conn; $da_im = $this->conn_im; $deptMgr = new Dept($da, $da_im, $this->container); $ds = $deptMgr->getinfo($deptid); if (!empty($ds)) { $deptid = $ds["fafa_deptid"]; $groupids = $deptMgr->getDeptDefaultGroup($deptid); if (!empty($groupids) && count($groupids) > 0) { $jid = $parameter["jid"]; $group_parameter = array(); for ($i = 0; $i < count($groupids); $i++) { $group_parameter["jid"] = $jid; $group_parameter["groupid"] = $groupids[$i]["groupid"]; $this->delGroupMember($group_parameter); } } } return true; } catch (\Exception $e) { $this->logger->err($e); return false; } }
public function queryAllCount($paramObj) { $deptid = isset($paramObj['deptid']) ? $paramObj['deptid'] : ''; $info = $this->getInfo(); $eno = $info["eno"]; $edomain = $this->container->getParameter("edomain"); $deptObj = new Dept($this->conn, $this->conn_im, $this->container); if (empty($deptid)) { $sql = 'select count(1) cnt from im_employee where loginname like concat(\'%\',?) '; $result = $this->conn_im->GetData('t', $sql, array($eno . '@' . $edomain)); $result = $result['t']['rows']; } else { $deptdata = $deptObj->getinfo($deptid); $path = $deptdata['path']; $sql = 'select count(1) cnt from im_employee a,im_base_dept b where a.deptid=b.deptid and b.path like concat(?,\'%\') and a.loginname like concat(\'%\',?) '; $result = $this->conn_im->GetData('t', $sql, array((string) $path, $eno . '@' . $edomain)); $result = $result['t']['rows']; } return $result[0]['cnt']; }