public function hintsetAction()
 {
     $request = $this->getRequest();
     try {
         $curuser = $this->get('security.context')->getToken()->getUser();
         //获取要设置的对象。暂时只有圈子和群组2种
         $type = $request->get("type");
         $action = $request->get("action");
         $cur_account = $curuser->getUsername();
         $re["returncode"] = ReturnCode::$SUCCESS;
         if ($type == "groupid") {
             $g = new \Justsy\BaseBundle\Management\GroupMgr($this->get('we_data_access'), $this->get('we_data_access_im'));
             $g->setHint($request->get("id"), $curuser, $action);
         } else {
             if ($type == "circleid") {
                 $c = new \Justsy\BaseBundle\Management\CircleMgr($this->get('we_data_access'), $this->get('we_data_access_im'), $request->get("id"));
                 $c->setHint($curuser, $action);
             } else {
                 $re["returncode"] = ReturnCode::$SYSERROR;
                 $re["msg"] = "无效的类型";
             }
         }
     } catch (\Exception $e) {
         $re["returncode"] = ReturnCode::$SYSERROR;
         $re["msg"] = "系统错误";
     }
     $response = new Response($request->get('jsoncallback') ? $request->get('jsoncallback') . "(" . json_encode($re) . ");" : json_encode($re));
     $response->headers->set('Content-Type', 'text/json');
     return $response;
 }
Beispiel #2
0
 public function joincircleAction()
 {
     //判断请求域。是wefafa或子域则不验证授权令牌
     $isWeFaFaDomain = $this->checkWWWDomain();
     $res = $this->get("request");
     $da = $this->get("we_data_access");
     if (!$isWeFaFaDomain) {
         $token = $this->checkAccessToken($res, $da);
         if (!$token) {
             $re = array("returncode" => "9999");
             $re["code"] = "err0105";
             $re["msg"] = "参数Appid或Openid或Access_token未指定或无效。";
             $response = new Response($res->get('jsoncallback') ? $res->get('jsoncallback') . "(" . json_encode($re) . ");" : json_encode($re));
             $response->headers->set('Content-Type', 'text/json');
             return $response;
         }
     }
     //判断帐号是否有效
     $ds = $this->checkOpenid($da, $res->get("openid"));
     if ($ds === false) {
         $re = array("returncode" => "9999");
         $re["code"] = "err0199";
         $re["msg"] = "参数openid未指定或无效。";
         $response = new Response($res->get('jsoncallback') ? $res->get('jsoncallback') . "(" . json_encode($re) . ");" : json_encode($re));
         $response->headers->set('Content-Type', 'text/json');
         return $response;
     }
     $account_list = $res->get("lst");
     $circleid = $res->get("circleid");
     $nick_name = $ds['nick_name'];
     $fafa_jid = $ds['fafa_jid'];
     $account = $ds["login_account"];
     $circleMgr = new \Justsy\BaseBundle\Management\CircleMgr($da, $this->get("we_data_access_im"), $circleid);
     $circleObj = $circleMgr->Get();
     if ($circleObj == null) {
         $re = array("returncode" => "9999");
         $re["code"] = "err0199";
         $re["msg"] = "参数circleid未指定或无效。";
         $response = new Response($res->get('jsoncallback') ? $res->get('jsoncallback') . "(" . json_encode($re) . ");" : json_encode($re));
         $response->headers->set('Content-Type', 'text/json');
         return $response;
     }
     $save = empty($account_list) ? $circleMgr->joinCircle($account, $nick_name) : $circleMgr->batchJoinCircle($account_list);
     if (!$save) {
         $re = array("returncode" => "9999");
         $re["code"] = "err0199";
         $re["msg"] = "成员已存在";
         $response = new Response($res->get('jsoncallback') ? $res->get('jsoncallback') . "(" . json_encode($re) . ");" : json_encode($re));
         $response->headers->set('Content-Type', 'text/json');
         return $response;
     }
     $re = array("returncode" => "0000");
     $response = new Response($res->get('jsoncallback') ? $res->get('jsoncallback') . "(" . json_encode($re) . ");" : json_encode($re));
     $response->headers->set('Content-Type', 'text/json');
     return $response;
 }
Beispiel #3
0
 public function setcircleAction(Request $request)
 {
     $conn = $this->get('we_data_access');
     $conn_im = $this->get('we_data_access_im');
     $user = $this->get('security.context')->getToken()->getUser();
     $circleobj = $request->get('circleobj');
     $circleobj = explode(';', $circleobj);
     $result = array("success" => false, "msg" => "变更圈子动态设置失败");
     //var_dump($circleobj);
     if (!empty($circleobj)) {
         for ($i = 0; $i < count($circleobj); $i++) {
             $circlehint = explode('#', $circleobj[$i]);
             //var_dump($circlehint);
             if (count($circlehint) == 2) {
                 //var_dump($circlehint[1],$circlehint[0]);
                 $circleMgr = new \Justsy\BaseBundle\Management\CircleMgr($conn, $conn_im, $circlehint[0]);
                 $success = $circleMgr->setHint($user, $circlehint[1]);
                 //var_dump($success);
                 if ($success) {
                     $result = array("success" => true, "msg" => "变更圈子动态设置成功");
                 }
             }
         }
     }
     $response = new Response(json_encode($result));
     $response->headers->set('Content-Type', 'text/html');
     return $response;
 }
 public function sendPresence($conv_id, $da, $circle_id, $post_to_group, $type)
 {
     $groupid = "";
     $group_type = "group";
     $fafa_jid = array();
     $jid = "";
     if ($circle_id == "10000") {
         return;
     }
     $user = $this->get('security.context')->getToken()->getUser();
     if ($post_to_group != "ALL" && $post_to_group != "PRIVATE") {
         $groupObj = new \Justsy\BaseBundle\Management\GroupMgr($da, $this->get('we_data_access_im'), $this->container);
         $getGroupInfo = $groupObj->Get($post_to_group);
         $jid = $getGroupInfo["fafa_groupid"];
         $fafa_jid = $groupObj->getGroupMembersJid($post_to_group, "1");
         //获取允许接收群组动态通知的成员列表
         $groupid = $post_to_group;
     } else {
         $group_type = "circle";
         $groupid = $circle_id;
         $circlemgr = new \Justsy\BaseBundle\Management\CircleMgr($da, $this->get('we_data_access_im'));
         $getGroupInfo = $circlemgr->Get($circle_id);
         $jid = $getGroupInfo["fafa_groupid"];
         //判断是否是私密,私密时不向圈子成员发出席
         if ($post_to_group == "PRIVATE") {
             $group_type = "private";
         } else {
             if ($circle_id == "9999") {
                 $staffMgr = new \Justsy\BaseBundle\Management\Staff($da, $this->get('we_data_access_im'), $user, $this->get("logger"), $this->container);
                 $fafa_jid = $staffMgr->getFriendJidList($conv_id);
             } else {
                 $fafa_jid = $circlemgr->getCircleMembersJid($circle_id, "1");
             }
         }
     }
     $cc_jid = array();
     //获取抄送的人员jid
     $sql = "select b.fafa_jid from we_convers_notify a ,we_staff b where a.cc_login_account=b.login_account and conv_id=?";
     $ds = $da->getData("ds", $sql, array((string) $conv_id));
     if ($ds && count($ds["ds"]["rows"]) > 0) {
         for ($i = 0; $i < count($ds["ds"]["rows"]); $i++) {
             $cc_jid[] = $ds["ds"]["rows"][$i]["fafa_jid"];
         }
     }
     //发送即时消息
     $ec = new \Justsy\OpenAPIBundle\Controller\ApiController();
     $ec->setContainer($this->container);
     $message = array($group_type . "id" => $groupid, "t" => $type, "jid" => $jid);
     $link = $this->generateUrl("JustsyBaseBundle_view_oneconv", array("conv_root_id" => $conv_id), true);
     $linkButtons = Utils::makeBusButton(array(array("code" => "action", "text" => "详细", "blank" => "1", "value" => "")));
     //分次发送通知。每次200个号
     $c = 0;
     $sendAry = array();
     for ($i = 0; $i < count($fafa_jid); $i++) {
         $sendAry[] = $fafa_jid[$i];
         $c++;
         if ($c >= 200) {
             $r = $ec->sendPresence($user->fafa_jid, implode(",", $sendAry), "", json_encode($message), $link, $linkButtons, false, $group_type . "_newtrend");
             $c = 0;
             $sendAry = array();
         }
     }
     if ($c > 0) {
         $r = $ec->sendPresence($user->fafa_jid, implode(",", $sendAry), "", json_encode($message), $link, $linkButtons, false, $group_type . "_newtrend", "0");
     }
     if (count($cc_jid) > 0) {
         //给抄送人员推消息
         $r = $ec->sendMsg($user->fafa_jid, implode(",", $cc_jid), "", json_encode($message), $link, $linkButtons, false, "private_newtrend");
     }
 }
 public function getOfficialTrendWinAction($conv_root_id)
 {
     $FILE_WEBSERVER_URL = $this->container->getParameter('FILE_WEBSERVER_URL');
     $user = $this->get('security.context')->getToken()->getUser();
     $da = $this->get('we_data_access');
     $conv = new \Justsy\BaseBundle\Business\Conv();
     $ds = $conv->getOfficialTrend($da, $user, $conv_root_id, $FILE_WEBSERVER_URL);
     if (count($ds["we_convers_list"]["rows"]) == 0) {
         return new Response("");
     }
     $isGroup = $ds["we_convers_list"]["rows"][0]["post_to_group"];
     if ($isGroup != "ALL") {
         //获取群组logo
         $groupmgr = new \Justsy\BaseBundle\Management\GroupMgr($da, null);
         $groupdata = $groupmgr->Get($isGroup);
         if ($groupdata != null) {
             $ds["we_convers_list"]["rows"][0]["en_logo_path"] = $FILE_WEBSERVER_URL . (empty($groupdata["group_photo_path"]) ? "default_group.png" : $groupdata["group_photo_path"]);
         }
     } else {
         //判断是否是非企业圈子
         $circleid = $ds["we_convers_list"]["rows"][0]["post_to_circle"];
         if ($user->get_circle_id("") != $circleid) {
             $circlemgr = new \Justsy\BaseBundle\Management\CircleMgr($da, null);
             $data = $circlemgr->Get($circleid);
             if ($data != null) {
                 $ds["we_convers_list"]["rows"][0]["en_logo_path"] = $FILE_WEBSERVER_URL . (empty($data["logo_path"]) ? "default_cirle.png" : $data["logo_path"]);
             }
         }
     }
     if ($ds["we_convers_list"]["rows"][0]["auth_level"] != 'S') {
         $ds["we_convers_list"]["rows"][0]["vip_level"] = \Justsy\BaseBundle\Common\ExperienceLevel::getLevel($ds["we_convers_list"]["rows"][0]["total_point"]);
     } else {
         $ds["we_convers_list"]["rows"][0]["vip_level"] = "1";
         //
     }
     $css_level = (int) ($ds["we_convers_list"]["rows"][0]["we_level"] / 10);
     $para = array('this' => $this, 'ds' => $ds, 'css_level' => $css_level, "trend" => $this->getRequest()->get("trend"));
     return $this->render('JustsyBaseBundle:CDisplayArea:officialtrend_win.html.twig', $para);
 }
Beispiel #6
0
 public function getCircleMemberAction(Request $request)
 {
     $user = $this->get('security.context')->getToken()->getUser();
     $circleMgr = new \Justsy\BaseBundle\Management\CircleMgr($this->get("we_data_access"), $this->get("we_data_access_im"));
     $circleid = $request->get("circleid");
     $result = $circleMgr->getCircleMembers($circleid, $user->getUserName());
     $response = new Response(json_encode($result));
     $response->headers->set('Content-Type', 'text/json');
     return $response;
 }
 public function quitCircleAction($network_domain)
 {
     $re = array();
     $user = $this->get('security.context')->getToken()->getUser();
     $request = $this->getRequest();
     $circle_id = $user->get_circle_id($network_domain);
     $da = $this->get('we_data_access');
     $da_im = $this->get('we_data_access_im');
     $sql = "call p_quitcircle(?, ?, 0)";
     $params = array();
     $params[] = (string) $circle_id;
     $params[] = (string) $user->getUserName();
     $ds = $da->GetData("p_quitcircle", $sql, $params);
     if ($ds["p_quitcircle"]["rows"][0]["recode"] == "0") {
         //向成员发送通知
         $circleMgr = new \Justsy\BaseBundle\Management\CircleMgr($da, $da_im, $circle_id);
         $circleObj = $circleMgr->Get();
         if (!empty($circleObj)) {
             $goupCtl = new GroupController();
             $goupCtl->setContainer($this->container);
             $message = Utils::makeHTMLElementTag('employee', $user->fafa_jid, $user->nick_name) . "退出了圈子【" . $circleObj["circle_name"] . "】";
             $goupCtl->sendPresenceGroup($circleObj["fafa_groupid"], "group_deletemeber", $message);
         }
         $re = array('success' => '1');
     } else {
         $re = array('success' => '0');
         $logger = $this->container->get('logger');
         $logger->err("quitCircle Error circle_id:" . $circle_id . " msg:" . $ds["p_quitgroup"]["rows"][0]["remsg"]);
     }
     $response = new Response(json_encode($re));
     $response->headers->set('Content-Type', 'text/json');
     return $response;
 }
Beispiel #8
0
 public function sendInvitationAction()
 {
     $res = $this->getRequest();
     $im_sender = $this->container->getParameter('im_sender');
     $acts = $res->get('acts');
     $logger = $this->get('logger');
     $da = $this->get('we_data_access');
     $user = $this->get('security.context')->getToken()->getUser();
     $circleId = $res->get("circleId");
     $eno = $res->get('eno');
     $invMsg = $res->get('invMsg');
     $subject = $res->get('subject');
     $invRela = $res->get('invRela');
     $circleName = "";
     if (!empty($circleId)) {
         $circleMgr = new \Justsy\BaseBundle\Management\CircleMgr($da, $this->get('we_data_access_im'), null);
         $circleObj = $circleMgr->Get($circleId);
         if ($circleObj == null && (empty($eno) || $eno == "-1")) {
             return new Response('1');
         }
         $circleName = $circleObj["circle_name"];
     }
     $invInfo = array('inv_send_acc' => $user->getUsername(), 'inv_recv_acc' => '', 'eno' => '', 'inv_rela' => $invRela, 'inv_title' => '', 'inv_content' => '', 'active_addr' => '');
     $photourl = $this->container->getParameter('FILE_WEBSERVER_URL');
     $staff_e = array();
     $staff_c = array();
     $sql = "select c.login_account,c.nick_name,concat('" . $photourl . "',case trim(ifnull(c.photo_path,'')) when '' then null else c.photo_path end) as photo_path \nfrom we_staff c inner join we_circle_staff d on c.login_account=d.login_account where d.circle_id=(\nselect b.circle_id from we_staff a inner join we_circle b on a.eno=b.enterprise_no and a.login_account=?) limit 0,9";
     $ds = $da->GetData("staff", $sql, array((string) $user->getUsername()));
     if ($ds && $ds['staff']['recordcount'] > 0) {
         $staff_e = $ds['staff']['rows'];
     }
     $sql = "select a.login_account,a.nick_name,concat('" . $photourl . "',case trim(ifnull(a.photo_path,'')) when '' then null else a.photo_path end) as photo_path \nfrom we_staff a inner join we_circle_staff b on a.login_account=b.login_account\nwhere a.eno=(select eno from we_staff where login_account=?) and b.circle_id=? limit 0,9";
     $ds = $da->GetData("staff", $sql, array((string) $user->getUsername(), (string) $circleId));
     if ($ds && $ds['staff']['recordcount'] > 0) {
         $staff_c = $ds['staff']['rows'];
     }
     try {
         foreach ($acts as $key => $value) {
             $invacc = trim($value);
             $invInfo['inv_recv_acc'] = $invacc;
             //排除自己
             if ($invacc == $user->getUsername()) {
                 continue;
             }
             $sql = "select fafa_jid from we_staff where login_account=?";
             $ds = $da->GetData("we_staff", $sql, array((string) $invacc));
             $isReg = $ds && $ds['we_staff']['recordcount'] > 0;
             //是否已注册
             if (empty($eno) || $eno == "-1") {
                 //加入圈子
                 if ($isReg) {
                     //1.帐号存在,直接加入圈子
                     //受邀人员帐号,圈子id,邀请人帐号
                     $encode = DES::encrypt("{$invacc},{$circleId}," . $user->getUsername());
                     $activeurl = $this->generateUrl("JustsyBaseBundle_invite_agreejoincircle", array('para' => $encode, 'eno' => 'c' . $circleId), true);
                     $rejectactiveurl = $this->generateUrl("JustsyBaseBundle_invite_refuse", array('para' => $encode, 'eno' => 'c' . $circleId), true);
                     $txt = $this->renderView('JustsyBaseBundle:Invite:circle_invitation_msg.html.twig', array("ename" => $user->ename, "nick_name" => $user->nick_name, "activeurl" => $activeurl, 'circle_name' => $circleName, 'invMsg' => $invMsg));
                     $invInfo['eno'] = "c{$circleId}";
                     if (empty($subject)) {
                         if ($circleId == "9999") {
                             $invInfo['inv_title'] = $user->nick_name . " 邀请您加入TA的人脉圈";
                         } else {
                             $invInfo['inv_title'] = $user->nick_name . " 邀请您加入圈子【" . Utils::makeCircleTipHTMLTag($circleId, $circleName) . "】";
                         }
                     } else {
                         $invInfo['inv_title'] = $subject;
                     }
                     $invInfo['inv_content'] = $invMsg;
                     $invInfo['active_addr'] = $activeurl;
                     //保存邀请信息
                     InviteController::saveWeInvInfo($da, $invInfo);
                     //发送即时消息
                     $fafa_jid = $ds['we_staff']['rows'][0]['fafa_jid'];
                     if ($circleId == "9999") {
                         $message = Utils::makeHTMLElementTag('employee', $user->fafa_jid, $user->nick_name) . "邀请您加入TA的人脉圈";
                     } else {
                         $message = Utils::makeHTMLElementTag('employee', $user->fafa_jid, $user->nick_name) . "邀请您加入圈子【" . Utils::makeHTMLElementTag('circle', $circleObj["fafa_groupid"], $circleName) . "】";
                     }
                     $buttons = array();
                     $buttons[] = array("text" => "拒绝", "code" => "agree", "value" => "0", "link" => $rejectactiveurl);
                     $buttons[] = array("text" => "立即加入", "code" => "agree", "value" => "1", "link" => $activeurl);
                     Utils::sendImMessage($user->fafa_jid, $fafa_jid, "邀请加入圈子", $message, $this->container, "", Utils::makeBusButton($buttons), false, Utils::$systemmessage_code, "1");
                 } else {
                     //2.帐号不存在
                     $tmp = explode("@", $invacc);
                     $tmp = count($tmp) > 1 ? $tmp[1] : 'fafatime.com';
                     $sql = "select count(1) as cnt from we_public_domain where domain_name=?";
                     $ds = $da->GetData("we_public_domain", $sql, array((string) $tmp));
                     if ($ds && $ds['we_public_domain']['rows'][0]['cnt'] == 0) {
                         //2.1企业邮箱
                         $sql = "select eno from we_enterprise where edomain=?";
                         $ds = $da->GetData("we_enterprise", $sql, array((string) $tmp));
                         if ($ds && $ds['we_enterprise']['recordcount'] > 0) {
                             //2.1.1企业已创建 帐号,圈子id,企业edomain des encode
                             $eno = $ds['we_enterprise']['rows'][0]['eno'];
                             $encode = DES::encrypt($user->getUsername() . ",{$circleId},{$eno}");
                             $eno = "";
                             $activeurl = $this->generateUrl("JustsyBaseBundle_active_inv_s1", array('account' => DES::encrypt($invacc), 'invacc' => $encode), true);
                             $staff_t = $staff_e;
                             $has_e = "1";
                         } else {
                             //2.1.2企业未创建
                             $sql = "insert into we_register (login_account,ename,credential_path,active_code,ip,email_type,first_reg_date,last_reg_date,register_date,state_id) " . "select ?,'','','" . strtoupper(substr(uniqid(), 3, 10)) . "','" . $_SERVER['REMOTE_ADDR'] . "','1',now(),now(),now(),'0' from dual " . "where not exists (select 1 from we_register where login_account=?)";
                             $para = array($invacc, $invacc);
                             $da->ExecSQL($sql, $para);
                             //发送邮件 帐号,圈子id,邀请发送者帐号,邀请人企业名 des encode
                             $encode = DES::encrypt("{$invacc},{$circleId}," . $user->getUserName() . "," . $user->ename);
                             $activeurl = $this->generateUrl("JustsyBaseBundle_active_reg_s1", array('account' => $encode), true);
                             $staff_t = array();
                             $has_e = "0";
                         }
                         //保存邀请信息 circleid保存到eno字段,以字母'c'开头
                         if ($circleId == "-1") {
                             $invInfo['eno'] = "-1";
                             $title = empty($subject) ? $user->nick_name . " 邀请您加入Wefafa企业协作网络" : $subject;
                             $txt = $this->renderView("JustsyBaseBundle:Invite:enterprise_invitation.html.twig", array("ename" => $user->ename, "realName" => $user->nick_name, "activeurl" => $activeurl, "invMsg" => $invMsg, "staff" => $staff_t, "has_e" => $has_e));
                         } else {
                             if ($invRela == "0") {
                                 $has_e = "1";
                                 $staff_t = $staff_e;
                             } else {
                                 $has_e = "0";
                                 $staff_t = array();
                             }
                             $invInfo['eno'] = "c{$circleId}";
                             $title = empty($subject) ? $user->nick_name . " 邀请您加入 " . Utils::makeCircleTipHTMLTag($circleId, $circleName) . " 协作网络" : $subject;
                             $txt = $this->renderView('JustsyBaseBundle:Invite:circle_invitation.html.twig', array("ename" => $user->ename, "nick_name" => $user->nick_name, "activeurl" => $activeurl, 'circle_name' => $circleName, 'invMsg' => $invMsg, "staff" => $staff_t, "has_e" => $has_e));
                         }
                         $invInfo['inv_title'] = $title;
                         $invInfo['inv_content'] = $txt;
                         $invInfo['active_addr'] = $activeurl;
                         InviteController::saveWeInvInfo($da, $invInfo);
                         $title = empty($subject) ? $user->nick_name . " 邀请您加入 " . $circleName . " 协作网络" : $subject;
                         Utils::saveMail($da, $user->getUsername(), $invacc, $title, $txt, $invInfo['eno']);
                         //Utils::sendMail($this->get('mailer'),$title,$this->container->getParameter('mailer_user'),null,$invacc,$txt);
                     } else {
                         //2.2公共邮箱
                         if ($invRela == "0") {
                             //邀请同事
                             $eno = $user->eno;
                             $encode = DES::encrypt($user->getUsername() . ",{$circleId},{$eno}");
                             $eno = "";
                             $activeurl = $this->generateUrl("JustsyBaseBundle_active_inv_s1", array('account' => DES::encrypt($invacc), 'invacc' => $encode), true);
                             $txt = $this->renderView('JustsyBaseBundle:Invite:circle_invitation.html.twig', array("ename" => $user->ename, "nick_name" => $user->nick_name, "activeurl" => $activeurl, 'circle_name' => $circleName, 'invMsg' => $invMsg, "staff" => $staff_c, "has_e" => "1"));
                             //保存邀请信息 circleid保存到eno字段,以字母'c'开头
                             $invInfo['eno'] = "c{$circleId}";
                             $invInfo['inv_title'] = empty($subject) ? $user->nick_name . " 邀请您加入 " . Utils::makeCircleTipHTMLTag($circleId, $circleName) . " 协作网络" : $subject;
                             $invInfo['inv_content'] = $txt;
                             $invInfo['active_addr'] = $activeurl;
                             InviteController::saveWeInvInfo($da, $invInfo);
                             $invInfo['inv_title'] = empty($subject) ? $user->nick_name . " 邀请您加入 " . $circleName . " 协作网络" : $subject;
                             Utils::saveMail($da, $user->getUsername(), $invacc, $invInfo['inv_title'], $txt, $invInfo['eno']);
                             //Utils::sendMail($this->get('mailer'),"邀请加入圈子【".$circleName."】",$this->container->getParameter('mailer_user'),null,$invacc,$txt);
                         } else {
                             $sql = "insert into we_register (login_account,ename,credential_path,active_code,ip,email_type,first_reg_date,last_reg_date,register_date,state_id) " . "select ?,'','','" . strtoupper(substr(uniqid(), 3, 10)) . "','" . $_SERVER['REMOTE_ADDR'] . "','0',now(),now(),now(),'2' from dual " . "where not exists (select 1 from we_register where login_account=?)";
                             $para = array($invacc, $invacc);
                             $da->ExecSQL($sql, $para);
                             //发送邮件 帐号,圈子id,邀请发送者帐号,邀请人企业名 des encode
                             $encode = DES::encrypt("{$invacc},{$circleId}," . $user->getUserName() . "," . $user->ename);
                             $activeurl = $this->generateUrl("JustsyBaseBundle_active_reg_s1", array('account' => $encode), true);
                             if ($circleId == "-1") {
                                 $invInfo['eno'] = "-1";
                                 $circleName = "Wefafa企业";
                                 $title = empty($subject) ? $user->nick_name . " 邀请您加入" . $circleName . "协作网络" : $subject;
                                 $txt = $this->renderView("JustsyBaseBundle:Invite:enterprise_invitation.html.twig", array("ename" => $user->ename, "realName" => $user->nick_name, "activeurl" => $activeurl, "invMsg" => $invMsg, "staff" => array()));
                             } else {
                                 $invInfo['eno'] = "c{$circleId}";
                                 $title = empty($subject) ? $user->nick_name . " 邀请您加入 " . Utils::makeCircleTipHTMLTag($circleId, $circleName) . " 协作网络" : $subject;
                                 $txt = $this->renderView('JustsyBaseBundle:Invite:circle_invitation.html.twig', array("ename" => $user->ename, "nick_name" => $user->nick_name, "activeurl" => $activeurl, 'circle_name' => $circleName, 'invMsg' => $invMsg, "staff" => array()));
                             }
                             //保存邀请信息
                             $invInfo['inv_title'] = $title;
                             $invInfo['inv_content'] = $txt;
                             $invInfo['active_addr'] = $activeurl;
                             InviteController::saveWeInvInfo($da, $invInfo);
                             $invInfo['inv_title'] = empty($subject) ? $user->nick_name . " 邀请您加入 " . $circleName . " 协作网络" : $subject;
                             Utils::saveMail($da, $user->getUsername(), $invacc, $title, $txt, $invInfo['eno']);
                             //Utils::sendMail($this->get('mailer'),$title,$this->container->getParameter('mailer_user'),null,$invacc,$txt);
                         }
                     }
                 }
             } else {
                 //判断受邀请人是否已注册,已注册的不能再邀请加个企业圈子
                 //与邀请人不同企业域的其他企业邮箱不能加入
                 if (!$isReg) {
                     //加入企业
                     $activeurl = $this->generateUrl("JustsyBaseBundle_active_inv_s1", array('account' => DES::encrypt($invacc), 'invacc' => DES::encrypt($user->getUsername())), true);
                     $txt = $this->renderView("JustsyBaseBundle:Invite:enterprise_invitation.html.twig", array("ename" => $user->ename, "realName" => $user->nick_name, "activeurl" => $activeurl, "invMsg" => $invMsg, "staff" => $staff_e, "has_e" => "1"));
                     //保存邀请信息
                     $invInfo['eno'] = $eno;
                     $invInfo['inv_title'] = empty($subject) ? "您的同事 " . $user->nick_name . " 邀请您加入Wefafa企业协作网络" : $subject;
                     $invInfo['inv_content'] = $txt;
                     $invInfo['active_addr'] = $activeurl;
                     InviteController::saveWeInvInfo($da, $invInfo);
                     Utils::saveMail($da, $user->getUsername(), $invacc, $invInfo['inv_title'], $txt, $invInfo['eno']);
                 }
             }
         }
     } catch (\Exception $e) {
         $logger->err($e);
         return new Response('0');
     }
     return new Response('1');
 }