public function __construct()
 {
     if (is_weixin() === true) {
         header('Location: http://m.renrenlie.com/');
     }
     parent::__construct();
     if (!empty($_SESSION['username']) || !empty($_SESSION['cusername'])) {
         $username = $_SESSION['username'] ? $_SESSION['username'] : $_SESSION['cusername'];
         $decide = M('userinfo')->where("username='******'")->select();
         if (!empty($decide)) {
             $table = array();
             foreach ($decide as $key => $val) {
                 $table = $decide[$key];
             }
             //判断是企业or推荐人 1企业用户 0推荐人
             if ($table["flag"] == "0") {
                 $data['url'] = U('Login/userinfo');
                 $data['logout'] = U('Login/logout');
                 $data['savepass'] = U('Login/savepass');
             } else {
                 if ($table["flag"] == "1") {
                     $data['url'] = U('Company/EnterpriseInformation');
                     $data['logout'] = U('Login/logout');
                     $data['savepass'] = U('Login/savepass');
                 }
             }
             $this->assign("data", $data);
         }
     }
 }
 public function __construct()
 {
     parent::__construct();
     $model = M('casclist', 'stj_', 'DB_CONFIG1');
     $position = $model->where("id in (641,642,643,648,649,645,970)")->order("orderid asc")->select();
     $model2 = M('userinfo', 'stj_', 'DB_CONFIG1');
     if (!empty($_SESSION['username']) || !empty($_SESSION['cusername'])) {
         $username = $_SESSION['username'] ? $_SESSION['username'] : $_SESSION['cusername'];
         $decide = $model2->where("username='******'")->find();
         if (!empty($decide)) {
             $table = array();
             foreach ($decide as $key => $val) {
                 $table = $decide[$key];
             }
             //判断是企业or推荐人 1企业用户 0推荐人
             if ($table["flag"] == "0") {
                 $data['url'] = U('Login/userinfo');
                 $data['logout'] = U('Login/logout');
                 $data['savepass'] = U('Login/savepass');
             } else {
                 if ($table["flag"] == "1") {
                     $data['url'] = U('Company/EnterpriseInformation');
                     $data['logout'] = U('Login/logout');
                     $data['savepass'] = U('Login/savepass');
                 }
             }
             $this->assign("data", $data);
         }
     }
     $this->position = $position;
 }