From b6cdf2b6f03ced244f5fd4c4c5b80ddd15967bd1 Mon Sep 17 00:00:00 2001
From: sefon <809775195@qq.com>
Date: Wed, 4 May 2016 17:56:34 +0800
Subject: [PATCH] add app_version

---
 library/LibModels/Wap/Product/ShopData.php                              |  4 +---
 library/Plugin/DataProcess/ShopProcess.php                              |  2 ++
 yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php | 17 +++++------------
 3 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/library/LibModels/Wap/Product/ShopData.php b/library/LibModels/Wap/Product/ShopData.php
index bcf49f8..891d351 100644
--- a/library/LibModels/Wap/Product/ShopData.php
+++ b/library/LibModels/Wap/Product/ShopData.php
@@ -122,9 +122,7 @@ class ShopData
             $param['gender'] = $gender;
         }
         $param['client_secret'] = Sign::getSign($param);
-        //TODO
-//        return Yohobuy::get(Yohobuy::API_URL, $param);
-        return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param);
+        return Yohobuy::get(Yohobuy::API_URL, $param);
     }
 
     /**
diff --git a/library/Plugin/DataProcess/ShopProcess.php b/library/Plugin/DataProcess/ShopProcess.php
index 1fa111d..679a11b 100644
--- a/library/Plugin/DataProcess/ShopProcess.php
+++ b/library/Plugin/DataProcess/ShopProcess.php
@@ -49,6 +49,8 @@ class ShopProcess
         self::$shopData['allGoods'] = Helpers::url('', array('shop_id' => self::$shopId, 'title' => '全部商品'), 'search');
         //搜索链接
         self::$shopData['url'] = Helpers::url('', array('shop_id' => self::$shopId), 'search');
+        //人气单品的链接
+        self::$shopData['more_url'] = Helpers::url('', array('shop_id' => self::$shopId, 'order' => 's_n_d', 'title' => '人气'), 'search');
     }
 
     /**
diff --git a/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php b/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
index 8c7c739..24e34be 100644
--- a/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
+++ b/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Index.php
@@ -464,8 +464,11 @@ class IndexController extends AbstractAction
     {
         $uid = $this->getUid(true);
         $data = ListModel::shopData($shopId, $uid);
-        if (!$this->isApp()) {
+        $appVersion = $this->get('app_version');
+        if (empty($appVersion)) {
             $this->setNavHeader('', true, SITE_MAIN);
+        } else {
+            $data['app_version'] = $appVersion;
         }
         $this->_view->display('shop', array(
             'shopIndex' => $data,
@@ -474,16 +477,6 @@ class IndexController extends AbstractAction
     }
 
     /**
-     * 判断是不是APP
-     *
-     * @return bool
-     */
-    public function isApp(){
-        $appVersion = $this->get('app_version');
-        return !empty($appVersion);
-    }
-
-    /**
      * 店铺收藏
      * @author sefon 2016-4-28 23:00:11
      */
@@ -542,7 +535,7 @@ class IndexController extends AbstractAction
             'branerImg' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026e96d1b403d28407650c7228bb4ca405.jpg?imageView2/2/w/640/h/200',
             'logoImg' => '',
             'storeName' => 'Vans专营店',
-            'collect' => true,
+            'collect' => false,
             'alreadyCollect' => 'product/collect.png',
             'notCollect' => '',
             'allGoods' => '',
--
libgit2 0.24.0