Beispiel #1
0
 /**
  * 添加员工
  *
  * @param array $data
  * @return int $id
  */
 private function memberAdd($info)
 {
     $data["UserNo"] = $info["EmployeeId"];
     $data["UserName"] = $info["Name"];
     $data["LoginName"] = $info["LoginName"];
     $data["Password"] = "******";
     $data["Verify"] = "%";
     $data["Mobil"] = $info["Mobile"];
     $data["Nodetype"] = "x";
     $data["OrganId"] = $info["OrganId"];
     $data["DeptId"] = $info["DeptId"];
     $data["UserId"] = $info["UserId"];
     $model = new DeptModel();
     if ($info["DeptId"]) {
         $result = $model->find("DeptId = '" . $info["DeptId"] . "' and Type ='Department'");
         if (!$result) {
             $this->addLog("member-no parent dept:" . $info["DeptId"]);
             return false;
         }
     } else {
         $result = $model->find("OrganId = '" . $info["OrganId"] . "' and Type ='Organ'");
         if (!$result) {
             $this->addLog("member-no organ organ:" . $info["OrganId"]);
             return false;
         }
     }
     $data["Upnode"] = $result["DeptNo"];
     $model = new MemberModel();
     //添加
     $result = $model->add($data);
     return $result;
 }