|
@@ -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,66 @@ class IndexController extends AbstractAction |
|
@@ -36,11 +37,66 @@ class IndexController extends AbstractAction |
36
|
*/
|
37
|
*/
|
37
|
public function categoryAction()
|
38
|
public function categoryAction()
|
38
|
{
|
39
|
{
|
39
|
- //$result = array();
|
40
|
+ $requestData = filter_input_array(INPUT_GET, array(
|
|
|
41
|
+ 'shops_id' => FILTER_DEFAULT,
|
|
|
42
|
+ ));
|
|
|
43
|
+ if (empty($requestData['shops_id'])) {
|
|
|
44
|
+ $this->go(SITE_MAIN);
|
|
|
45
|
+ }
|
|
|
46
|
+ $result = array();
|
|
|
47
|
+ $resource = array();
|
|
|
48
|
+ $resource['category'] = ShopData::getShopCategory($requestData['shops_id'], Helpers::getChannelByCookie(), Helpers::getGenderByCookie());
|
|
|
49
|
+ $resource['brands'] = ShopData::getShopBrands($requestData['shops_id']);
|
|
|
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
|
+ $result = array();
|
40
|
// 假数据
|
57
|
// 假数据
|
41
|
- // $result = $this->getCategoryContent();
|
58
|
+ $result = $this->getCategoryContent();
|
|
|
59
|
+// ShopData::debugOut($result);
|
42
|
//$result2 = IntroData::getShopIntro(356);
|
60
|
//$result2 = IntroData::getShopIntro(356);
|
43
|
- $result = array(
|
61
|
+ return $this->_view->display('category', array(
|
|
|
62
|
+ 'productCategoryPage' => true,
|
|
|
63
|
+ 'content' => $result,
|
|
|
64
|
+ ));
|
|
|
65
|
+ }
|
|
|
66
|
+
|
|
|
67
|
+ /**
|
|
|
68
|
+ * 店铺简介页面
|
|
|
69
|
+ *
|
|
|
70
|
+ * @return mixed
|
|
|
71
|
+ */
|
|
|
72
|
+ public function introAction()
|
|
|
73
|
+ {
|
|
|
74
|
+ $requestData = filter_input_array(INPUT_GET, array(
|
|
|
75
|
+ 'shops_id' => FILTER_DEFAULT,
|
|
|
76
|
+ ));
|
|
|
77
|
+ if (empty($requestData['shops_id'])) {
|
|
|
78
|
+ $this->go(SITE_MAIN);
|
|
|
79
|
+ }
|
|
|
80
|
+ $result = array();
|
|
|
81
|
+ $resource = ShopData::getShopIntro($requestData['shops_id']);
|
|
|
82
|
+ if ($resource['code'] === 200) {
|
|
|
83
|
+ $result = $resource['data'];
|
|
|
84
|
+ }
|
|
|
85
|
+ return $this->_view->display('intro', array(
|
|
|
86
|
+ 'content' => $result,
|
|
|
87
|
+ ));
|
|
|
88
|
+
|
|
|
89
|
+ }
|
|
|
90
|
+
|
|
|
91
|
+
|
|
|
92
|
+ /**
|
|
|
93
|
+ * 店铺分类品类页数据模拟
|
|
|
94
|
+ *
|
|
|
95
|
+ * @return array
|
|
|
96
|
+ */
|
|
|
97
|
+ public function getCategoryContent()
|
|
|
98
|
+ {
|
|
|
99
|
+ return array(// 数据模拟
|
44
|
'class' => array(
|
100
|
'class' => array(
|
45
|
array(
|
101
|
array(
|
46
|
'name' => '上衣',
|
102
|
'name' => '上衣',
|
|
@@ -124,47 +180,6 @@ class IndexController extends AbstractAction |
|
@@ -124,47 +180,6 @@ class IndexController extends AbstractAction |
124
|
|
180
|
|
125
|
)
|
181
|
)
|
126
|
);
|
182
|
);
|
127
|
- return $this->_view->display('category', array(
|
|
|
128
|
- 'productCategoryPage' => true,
|
|
|
129
|
- 'content' => $result,
|
|
|
130
|
- ));
|
|
|
131
|
- }
|
|
|
132
|
-
|
|
|
133
|
- /**
|
|
|
134
|
- * 店铺简介页面
|
|
|
135
|
- *
|
|
|
136
|
- * @return mixed
|
|
|
137
|
- */
|
|
|
138
|
- public function introAction()
|
|
|
139
|
- {
|
|
|
140
|
- $requestData = filter_input_array(INPUT_GET, array(
|
|
|
141
|
- 'shopId' => FILTER_DEFAULT,
|
|
|
142
|
- ));
|
|
|
143
|
- if (empty($requestData['shopId'])) {
|
|
|
144
|
- $this->go(SITE_MAIN);
|
|
|
145
|
- }
|
|
|
146
|
- $result = array();
|
|
|
147
|
- $resource = ShopData::getShopIntro($requestData['shopId']);
|
|
|
148
|
- if($resource['code'] === 200){
|
|
|
149
|
- $result = $resource['data'];
|
|
|
150
|
- }
|
|
|
151
|
- return $this->_view->display('intro', array(
|
|
|
152
|
- 'content' => $result,
|
|
|
153
|
- ));
|
|
|
154
|
-
|
|
|
155
|
- }
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
- /**
|
|
|
159
|
- * 店铺分类品类页数据模拟
|
|
|
160
|
- *
|
|
|
161
|
- * @return array
|
|
|
162
|
- */
|
|
|
163
|
- public function getCategoryContent()
|
|
|
164
|
- {
|
|
|
165
|
- return array(
|
|
|
166
|
- // 数据模拟
|
|
|
167
|
- );
|
|
|
168
|
}
|
183
|
}
|
169
|
|
184
|
|
170
|
/**
|
185
|
/**
|
|
@@ -174,8 +189,7 @@ class IndexController extends AbstractAction |
|
@@ -174,8 +189,7 @@ class IndexController extends AbstractAction |
174
|
*/
|
189
|
*/
|
175
|
public function getIntroContent()
|
190
|
public function getIntroContent()
|
176
|
{
|
191
|
{
|
177
|
- return array(
|
|
|
178
|
- // 数据模拟
|
192
|
+ return array(// 数据模拟
|
179
|
);
|
193
|
);
|
180
|
}
|
194
|
}
|
181
|
|
195
|
|