Ejemplo n.º 1
0
 public function index()
 {
     $m = M('Company_product');
     $opt['type'] = 'item';
     $opt['brandId'] = 120;
     $opt['enable'] = 1;
     $result = $m->where($opt)->select();
     $userInfo = session('userInfo');
     if (!$userInfo) {
         $userInfo = \Mobile\Gereral\User::getUserInfo();
     }
     if ($userInfo) {
         $userId = $userInfo['id'];
     } else {
         $userId = 0;
     }
     $this->assign('userId', $userId);
     if (session('orderInfo')) {
         $tmp = session('orderInfo');
         $tmp['userId'] = $userId;
         session('orderInfo', $tmp);
     }
     $this->assign('shopInfo', $orderInfo = session('orderInfo'));
     $this->assign('products', $result);
     $this->display();
 }
Ejemplo n.º 2
0
 public function index()
 {
     $userInfo = \Mobile\Gereral\User::getUserInfo();
     if ($userInfo) {
         $userId = $userInfo['id'];
     } else {
         $userId = 0;
     }
     $m = M('Company_product');
     $result = $m->select();
     $this->assign('userId', $userId);
     $this->assign('productInfo', $result);
     $this->display();
 }
Ejemplo n.º 3
0
 public function index()
 {
     //测试专用
     //session('userInfo', $this->getUserInfo(I('get.openid')));
     //
     //
     $userInfo = \Mobile\Gereral\User::getUserInfo();
     if ($userInfo) {
         $userId = $userInfo['id'];
     } else {
         $userId = 0;
     }
     $this->assign('userId', $userId);
     $this->display();
 }
Ejemplo n.º 4
0
 public function index()
 {
     $userInfo = \Mobile\Gereral\User::getUserInfo();
     if ($userInfo) {
         $userId = $userInfo['id'];
     } else {
         $userId = 0;
     }
     $m = M('Company_product');
     $opt['brandId'] = 120;
     $opt['enable'] = 1;
     $result = $m->where($opt)->order('type desc,id')->select();
     $this->assign('userId', $userId);
     $this->assign('productInfo', $result);
     $this->display();
 }
Ejemplo n.º 5
0
 public function index()
 {
     $productInfo = $this->getProductInfo(121);
     $userInfo = session('userInfo');
     $this->assign('productInfo', $productInfo);
     if ($this->is_mobile()) {
         if (!$userInfo) {
             $openid = I('get.openid');
             if ($openid) {
                 $userInfo = $this->getUserInfo($openid);
                 if ($userInfo) {
                     session('userInfo', $userInfo);
                 }
             }
             $userInfo = \Mobile\Gereral\User::getUserInfo();
         }
         $this->assign('userInfo', $userInfo);
         $this->theme('mobile')->display();
     } else {
         $this->assign('userInfo', $userInfo);
         $this->display();
     }
 }
Ejemplo n.º 6
0
 public function news()
 {
     $userInfo = \Mobile\Gereral\User::getUserInfo();
     $data = M("Company_news")->where("id = " . $_GET["id"])->find();
     $data['content'] = htmlspecialchars_decode($data['content']);
     $params = I('get.');
     $this->saveRead($params);
     $this->assign('userInfo', $userInfo);
     $this->assign('newsArr', $data);
     //$this->assign( 'params', $session);
     //
     $weObj = new TPWechat(array('appid' => 'wx043fe26d7171dc76', 'appsecret' => '9075a78a413ea5f12999e0fddcc2a60c'));
     $auth = $weObj->checkAuth();
     $api_ticket = $weObj->getJsTicket();
     $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     $js_sign = $weObj->getJsSign($url);
     $time = time();
     $this->assign('js_sign', $js_sign);
     $this->display();
     // if(S('news_view_'.$params['r'])){
     //   $this->assign( 'newsArr' , $data );
     //   $this->assign( 'params', $session);
     //   $this->display();
     // }else{
     //   $url = \Weixin\Response\WechatConst::REDIRECT_DOMAIN . "ecid={$params['ecid']}&type=news&fromOpenId={$params['openid']}&from_type=1&newsId={$params['id']}";
     //   $base_url = $this->getOauthUrl($url, $params['ecid']);
     //   header("Location: {$base_url}");
     // }
 }