|
@@ -9,6 +9,7 @@ |
|
@@ -9,6 +9,7 @@ |
9
|
|
9
|
|
10
|
use Action\AbstractAction;
|
10
|
use Action\AbstractAction;
|
11
|
use LibModels\Wap\Shop\ShopData;
|
11
|
use LibModels\Wap\Shop\ShopData;
|
|
|
12
|
+use Plugin\Helpers;
|
12
|
|
13
|
|
13
|
class IndexController extends AbstractAction
|
14
|
class IndexController extends AbstractAction
|
14
|
{
|
15
|
{
|
|
@@ -36,11 +37,23 @@ class IndexController extends AbstractAction |
|
@@ -36,11 +37,23 @@ class IndexController extends AbstractAction |
36
|
*/
|
37
|
*/
|
37
|
public function categoryAction()
|
38
|
public function categoryAction()
|
38
|
{
|
39
|
{
|
|
|
40
|
+ $requestData = filter_input_array(INPUT_GET, array(
|
|
|
41
|
+ 'shopId' => FILTER_DEFAULT,
|
|
|
42
|
+ ));
|
|
|
43
|
+ if (empty($requestData['shopId'])) {
|
|
|
44
|
+ $this->go(SITE_MAIN);
|
|
|
45
|
+ }
|
39
|
$result = array();
|
46
|
$result = array();
|
40
|
- // 假数据
|
|
|
41
|
- $result = $this->getCategoryContent();
|
|
|
42
|
- $result2 = ShopData::getShopIntro(356);
|
|
|
43
|
-
|
47
|
+ $resource = array();
|
|
|
48
|
+ $resource['category'] = ShopData::getShopCategory($requestData['shopId'], Helpers::getChannelByCookie(), Helpers::getGenderByCookie());
|
|
|
49
|
+ $resource['brands'] = ShopData::getShopBrands($requestData['shopId']);
|
|
|
50
|
+ if($resource['category']['code'] === 200){
|
|
|
51
|
+ $result['category'] = $resource['category']['data'];
|
|
|
52
|
+ }
|
|
|
53
|
+ if($resource['brands']['code'] === 200){
|
|
|
54
|
+ $result['brands'] = $resource['brands']['data'];
|
|
|
55
|
+ }
|
|
|
56
|
+ ShopData::debugOut($result);
|
44
|
return $this->_view->display('category', array(
|
57
|
return $this->_view->display('category', array(
|
45
|
'content' => $result,
|
58
|
'content' => $result,
|
46
|
));
|
59
|
));
|
|
@@ -61,7 +74,7 @@ class IndexController extends AbstractAction |
|
@@ -61,7 +74,7 @@ class IndexController extends AbstractAction |
61
|
}
|
74
|
}
|
62
|
$result = array();
|
75
|
$result = array();
|
63
|
$resource = ShopData::getShopIntro($requestData['shopId']);
|
76
|
$resource = ShopData::getShopIntro($requestData['shopId']);
|
64
|
- if($resource['code'] === 200){
|
77
|
+ if ($resource['code'] === 200) {
|
65
|
$result = $resource['data'];
|
78
|
$result = $resource['data'];
|
66
|
}
|
79
|
}
|
67
|
return $this->_view->display('intro', array(
|
80
|
return $this->_view->display('intro', array(
|
|
@@ -78,8 +91,7 @@ class IndexController extends AbstractAction |
|
@@ -78,8 +91,7 @@ class IndexController extends AbstractAction |
78
|
*/
|
91
|
*/
|
79
|
public function getCategoryContent()
|
92
|
public function getCategoryContent()
|
80
|
{
|
93
|
{
|
81
|
- return array(
|
|
|
82
|
- // 数据模拟
|
94
|
+ return array(// 数据模拟
|
83
|
);
|
95
|
);
|
84
|
}
|
96
|
}
|
85
|
|
97
|
|
|
@@ -90,8 +102,7 @@ class IndexController extends AbstractAction |
|
@@ -90,8 +102,7 @@ class IndexController extends AbstractAction |
90
|
*/
|
102
|
*/
|
91
|
public function getIntroContent()
|
103
|
public function getIntroContent()
|
92
|
{
|
104
|
{
|
93
|
- return array(
|
|
|
94
|
- // 数据模拟
|
105
|
+ return array(// 数据模拟
|
95
|
);
|
106
|
);
|
96
|
}
|
107
|
}
|
97
|
|
108
|
|