public function push_receiverlistAction() { $da = $this->get("we_data_access"); $da_im = $this->get('we_data_access_im'); $request = $this->getRequest(); //访问权限校验 $api = new \Justsy\OpenAPIBundle\Controller\ApiController(); $api->setContainer($this->container); $isWeFaFaDomain = $api->checkWWWDomain(); if (!$isWeFaFaDomain) { $token = $api->checkAccessToken($request, $da); if (!$token) { $re = array("returncode" => "9999"); $re["code"] = "err0105"; $re["msg"] = "参数Appid或Openid或Access_token未指定或无效."; return $this->responseJson($request, $re); } } $openid = $request->get("openid"); $staffinfo = new \Justsy\BaseBundle\Management\Staff($da, $da_im, $openid, $this->get("logger"), $this->container); $staffdata = $staffinfo->getInfo(); if (empty($staffdata)) { $result = Utils::WrapResultError("无效操作帐号"); return $this->responseJson($request, $result); } $appid = $request->get('appid'); $appmgr = new \Justsy\BaseBundle\Management\App($this->container); $appdata = $appmgr->getappinfo(array('appid' => $appid)); if (empty($appdata)) { $result = Utils::WrapResultError("无效应用标识"); return $this->responseJson($request, $result); } $data = $request->get("data"); //部门名称 if (empty($data)) { $result = Utils::WrapResultError("无效的数据"); return $this->responseJson($request, $result); } $data = json_decode($data, true); $noticeMgr = new \Justsy\BaseBundle\Management\PromptlyNotice($this->container, $staffdata, $appdata); $result = $noticeMgr->getReceiverList($data); return $this->responseJson($request, $result); }
public function SaveEnoAuthAction() { $da = $this->get('we_data_access'); $request = $this->getRequest(); $user = $this->get('security.context')->getToken()->getUser(); $eno = $user->eno; $account = $this->get('security.context')->getToken()->getUser()->getUserName(); $ename = $request->get('ename'); $eshortname = $request->get('eshortname'); $industry = $request->get('industry'); $phone = $request->get('phone'); $addr = $request->get('addr'); $mobile = $request->get('mobile'); $fax = $request->get('fax'); $website = $request->get('website'); //$filedata=$request->get('certificate'); //$filename=$_FILES['certificate']['name']; $re = array('s' => '1', 'm' => ''); //数据校验 //$re=$this->vilidate(); if ($re['s'] == '1') { //证件保存 //$fileid=$this->saveCertificate($filedata,$filename); // if(empty($fileid)) // { // $re=array('s'=>'0','m'=>'有效证件提交失败!'); // } //判断是否有证件 $sql1 = "select 1 from we_enterprise where eno=? and eno_level=?"; $params1 = array($user->eno, Identify::$MIdent); $ds = $da->Getdata('path', $sql1, $params1); if ($ds['path']['recordcount'] == 0) { $re = array('s' => '0', 'm' => '您的企业不需要认证!'); } if ($re['s'] == '1') { //判断是否有证件 $sql1 = "select 1 from we_enterprise where eno=? and credential_path is not null and credential_path!=''"; $params1 = array($user->eno); $ds = $da->Getdata('path', $sql1, $params1); if ($ds['path']['recordcount'] == 0) { $re = array('s' => '0', 'm' => '请先上传证件!'); } //保存企业认证信息 if ($re['s'] == '1') { //$sql[]="update we_enterprise set industry=?,addr=?,telephone=?,fax=?,ewww=? where eno=?"; //$params[]=array($industry,$addr,$phone,$fax,$website,$eno); //保存申请到申请表中 $apply_id = SysSeq::GetSeqNextValue($da, "we_apply", "id"); $sql[] = "insert into we_apply (id,account,recv_type,recv_id,content,is_valid,apply_date) values(?,?,?,null,null,?,now())"; $params[] = array($apply_id, $user->eno, 'e', '1'); if (!$da->ExecSQLs($sql, $params)) { $re = array('s' => '0', 'm' => '认证信息提交失败!'); } if ($re['s'] == '1') { //通知运营人员 $resd = new \Justsy\BaseBundle\Management\PromptlyNotice($da, $this->get('logger')); Utils::sendImMessage('', implode(',', $resd->getRecv('0002')), "企业身份认证", $user->nick_name . "创建的企业【" . $user->ename . "】请求通过企业身份认证,请及时处理。", $this->container, "", "", true, Utils::$systemmessage_code); } } } } $response = new Response(json_encode($re)); $response->headers->set('Content-Type', 'text/json'); return $response; }