Пример #1
0
 public function rightMicroAppAction($network_domain)
 {
     $conn = $this->get('we_data_access');
     $conn_im = $this->get('we_data_access_im');
     $userinfo = $this->get('security.context')->getToken()->getUser();
     $eno = $userinfo->getEno();
     $logger = $this->get("logger");
     $MicroAccountMgr = new MicroAccountMgr($conn, $conn_im, $userinfo, $logger, $this->container);
     $listMA = $MicroAccountMgr->getmicroaccount(false, 1);
     $micro_app_count = count($listMA);
     $EnoParamManager = new EnoParamManager($conn, $logger);
     $micro_app_allow_count = $EnoParamManager->getCountCreateAppMicroAccount($eno);
     $data = array();
     $data['curr_network_domain'] = $network_domain;
     $data["listMA"] = $listMA;
     $data['micro_app_cancount'] = (int) $micro_app_allow_count - (int) $micro_app_count;
     if ($data['micro_app_cancount'] < 0) {
         $data['micro_app_cancount'] = 0;
     }
     $htmlfile = 'JustsyBaseBundle:EnterpriseHome:right_microapp_0.html.twig';
     if ($micro_app_count > 5) {
         $htmlfile = 'JustsyBaseBundle:EnterpriseHome:right_microapp_n.html.twig';
     } else {
         if ($micro_app_count > 0) {
             $htmlfile = 'JustsyBaseBundle:EnterpriseHome:right_microapp_5.html.twig';
         } else {
             $htmlfile = 'JustsyBaseBundle:EnterpriseHome:right_microapp_0.html.twig';
         }
     }
     return $this->render($htmlfile, $data);
 }
Пример #2
0
 public function microaccount_addAction($network_domain)
 {
     if (0 == $this->get('security.context')->getToken()->getUser()->is_in_manager_circles($network_domain)) {
         return $this->render('JustsyBaseBundle:EnterpriseSetting:no_rights.html.twig');
     }
     $conn = $this->get('we_data_access');
     $conn_im = $this->get('we_data_access_im');
     $userinfo = $this->get('security.context')->getToken()->getUser();
     $eno = $userinfo->getEno();
     $logger = $this->get("logger");
     $micro_id = $this->getRequest()->get("micro_id");
     $MicroAccountMgr = new MicroAccountMgr($conn, $conn_im, $userinfo, $logger, $this->container);
     if (!empty($micro_id)) {
         $data = $MicroAccountMgr->get_micro_data_id($micro_id);
         if (!empty($data)) {
             //$data[0]["logo_path"] = $this->container->getParameter('FILE_WEBSERVER_URL').$data[0]["logo_path"];
             //$data[0]["logo_path_big"] = $this->container->getParameter('FILE_WEBSERVER_URL').$data[0]["logo_path_big"];
             //$data[0]["logo_path_small"] = $this->container->getParameter('FILE_WEBSERVER_URL').$data[0]["logo_path_small"];
             $array["micro_data"] = json_encode($data);
         } else {
             $array["micro_data"] = "[]";
         }
     } else {
         $array["micro_data"] = "[]";
     }
     $array["curr_network_domain"] = $network_domain;
     $path = $this->get('templating.helper.assets')->geturl('bundles/fafatimewebase/images/no_photo.png');
     $array["path"] = $path;
     $EnoParamManager = new EnoParamManager($conn, $logger);
     //外部公众号企业对应参数
     $enoparam_external = $EnoParamManager->getParamByEno($userinfo->getEno(), 'micro_external_count');
     //内部公众号企业对应参数
     $enoparam_internal = $EnoParamManager->getParamByEno($userinfo->getEno(), 'micro_internal_count');
     //获取所有公众号已经创建个数和内部公众号已经创建个数
     $micro_count = $MicroAccountMgr->getmicrocount();
     //获取外部公众号一共能创建多少个数
     if (!empty($enoparam_external)) {
         $micro_external_param_value = $enoparam_external["micro_external_count"]["param_value"];
         $array["micro_external_param_value"] = $micro_external_param_value;
     } else {
         $array["micro_external_param_value"] = 0;
     }
     //获取内部公众号一共能创建多少个数
     if (!empty($enoparam_internal)) {
         $micro_internal_param_value = $enoparam_internal["micro_internal_count"]["param_value"];
         $array["micro_internal_param_value"] = $micro_internal_param_value;
     } else {
         $array["micro_internal_param_value"] = 0;
     }
     $array["micro_internal_count"] = $micro_count["count"];
     $array["micro_external_count"] = $micro_count["allcount"] - $micro_count["count"];
     $array["file_path"] = $this->container->getParameter('FILE_WEBSERVER_URL');
     return $this->render('JustsyBaseBundle:EnterpriseSetting:microaccount_add.html.twig', $array);
 }
Пример #3
0
 public function addAction($network_domain)
 {
     $conn = $this->get('we_data_access');
     $conn_im = $this->get('we_data_access_im');
     $userinfo = $this->get('security.context')->getToken()->getUser();
     $logger = $this->get("logger");
     $eno = $userinfo->getEno();
     $micro_id = $this->getRequest()->get("micro_id");
     $array["micro_app_data"] = '[]';
     if (!empty($micro_id)) {
         //读取数据
         $MicroAccountMgr = new MicroAccountMgr($conn, $conn_im, $userinfo, $logger, $this->container);
         $data = $MicroAccountMgr->get_micro_data_id($micro_id);
         if (!empty($data)) {
             //$data[0]["logo_path"] = $this->container->getParameter('FILE_WEBSERVER_URL').$data[0]["logo_path"];
             //$data[0]["logo_path_big"] = $this->container->getParameter('FILE_WEBSERVER_URL').$data[0]["logo_path_big"];
             //$data[0]["logo_path_small"] = $this->container->getParameter('FILE_WEBSERVER_URL').$data[0]["logo_path_small"];
             $array["micro_app_data"] = json_encode($data);
         } else {
             $array["micro_app_data"] = "[]";
         }
     }
     $path = $this->get('templating.helper.assets')->geturl('bundles/fafatimewebase/images/no_photo.png');
     $array["path"] = $path;
     $array["curr_network_domain"] = $network_domain;
     $EnoParamManager = new EnoParamManager($conn, $logger);
     //获取微应用允许创建总个数
     $micro_app_allow_count = $EnoParamManager->getCountCreateAppMicroAccount($eno);
     //var_dump($micro_app_allow_count);
     $array["micro_app_allow_count"] = $micro_app_allow_count;
     //if(!empty($micro_app_allow_count)) $array["micro_app_allow_count"]=$micro_app_allow_count["micro_app_count"]["param_value"];
     //获取已创建微应用个数
     $sql = "select count(1) as count from we_micro_account where eno=? and micro_use='1' ";
     $para = array($eno);
     $data = $conn->GetData('dt', $sql, $para);
     $array["micro_app_count"] = 0;
     if ($data != null && count($data['dt']['rows']) > 0 && !empty($data['dt']['rows'][0]['count'])) {
         $array["micro_app_count"] = $data['dt']['rows'][0]['count'];
     }
     $array["file_path"] = $this->container->getParameter('FILE_WEBSERVER_URL');
     return $this->render('JustsyBaseBundle:MicroApp:add.html.twig', $array);
 }