students product lists
Showing
8 changed files
with
42 additions
and
5 deletions
No preview for this file type
@@ -111,4 +111,27 @@ class ClassData | @@ -111,4 +111,27 @@ class ClassData | ||
111 | return Yohobuy::get(API_URL, $param); | 111 | return Yohobuy::get(API_URL, $param); |
112 | } | 112 | } |
113 | 113 | ||
114 | + /** | ||
115 | + * 学生专享商品 | ||
116 | + * | ||
117 | + */ | ||
118 | + public static function filterStudentsData($condition) | ||
119 | + { | ||
120 | + $param = Yohobuy::param(); | ||
121 | + $param['method'] = 'app.student.discount'; | ||
122 | + $param += $condition; | ||
123 | + if (!isset($param['order'])) { | ||
124 | + $param['order'] = 's_t_desc'; | ||
125 | + } | ||
126 | + if (!isset($param['limit'])) { | ||
127 | + $param['limit'] = 60; | ||
128 | + } | ||
129 | + if (!isset($param['page'])) { | ||
130 | + $param['page'] = 1; | ||
131 | + } | ||
132 | + $param['client_secret'] = Sign::getSign($param); | ||
133 | + | ||
134 | + return Yohobuy::get(API_URL, $param); | ||
135 | + } | ||
136 | + | ||
114 | } | 137 | } |
@@ -177,6 +177,11 @@ class SearchData | @@ -177,6 +177,11 @@ class SearchData | ||
177 | $param['ageLevel'] = $param['age_level']; | 177 | $param['ageLevel'] = $param['age_level']; |
178 | unset($param['age_level']); | 178 | unset($param['age_level']); |
179 | } | 179 | } |
180 | + if (isset($param['students'])) { | ||
181 | + $param['isStudentPrice'] = 'N'; | ||
182 | + $param['vdt'] = 1; | ||
183 | + unset($param['students']); | ||
184 | + } | ||
180 | return Yohobuy::get(self::getSearchUrl(), $param, $cache); | 185 | return Yohobuy::get(self::getSearchUrl(), $param, $cache); |
181 | } | 186 | } |
182 | 187 |
@@ -76,4 +76,7 @@ | @@ -76,4 +76,7 @@ | ||
76 | 76 | ||
77 | {{#if outlets}} | 77 | {{#if outlets}} |
78 | <input class="query-param" type="hidden" data-attr="outlets" value="{{outlets}}"> | 78 | <input class="query-param" type="hidden" data-attr="outlets" value="{{outlets}}"> |
79 | +{{/if}} | ||
80 | +{{#if students}} | ||
81 | +<input class="query-param" type="hidden" data-attr="students" value="{{students}}"> | ||
79 | {{/if}} | 82 | {{/if}} |
@@ -62,6 +62,7 @@ class SearchController extends AbstractAction | @@ -62,6 +62,7 @@ class SearchController extends AbstractAction | ||
62 | 'channel' => FILTER_DEFAULT, | 62 | 'channel' => FILTER_DEFAULT, |
63 | 'outlets' => FILTER_DEFAULT, | 63 | 'outlets' => FILTER_DEFAULT, |
64 | 'ageLevel' => FILTER_DEFAULT, | 64 | 'ageLevel' => FILTER_DEFAULT, |
65 | + 'students' => FILTER_DEFAULT, | ||
65 | 'p_d' => FILTER_DEFAULT,), false); | 66 | 'p_d' => FILTER_DEFAULT,), false); |
66 | if (isset($condition['shop_id'])) { | 67 | if (isset($condition['shop_id'])) { |
67 | $condition['shopId'] = $condition['shop_id']; | 68 | $condition['shopId'] = $condition['shop_id']; |
@@ -80,7 +81,7 @@ class SearchController extends AbstractAction | @@ -80,7 +81,7 @@ class SearchController extends AbstractAction | ||
80 | } | 81 | } |
81 | 82 | ||
82 | // 标识用户是否有输入搜索内容 | 83 | // 标识用户是否有输入搜索内容 |
83 | - $haveQuery = $query !== ''; | 84 | + $haveQuery = $query; |
84 | // 标识用户搜的是不是一级品类 | 85 | // 标识用户搜的是不是一级品类 |
85 | $isQueryFirstClass = false; | 86 | $isQueryFirstClass = false; |
86 | // 标识用户搜的是不是二级品类 | 87 | // 标识用户搜的是不是二级品类 |
@@ -252,6 +253,7 @@ class SearchController extends AbstractAction | @@ -252,6 +253,7 @@ class SearchController extends AbstractAction | ||
252 | 'p_d' => FILTER_DEFAULT, | 253 | 'p_d' => FILTER_DEFAULT, |
253 | 'outlets' => FILTER_DEFAULT, | 254 | 'outlets' => FILTER_DEFAULT, |
254 | 'age_level' => FILTER_DEFAULT, | 255 | 'age_level' => FILTER_DEFAULT, |
256 | + 'students' => FILTER_DEFAULT, | ||
255 | 'page' => FILTER_VALIDATE_INT,), false); | 257 | 'page' => FILTER_VALIDATE_INT,), false); |
256 | 258 | ||
257 | if (!empty($condition['shop_id'])) { | 259 | if (!empty($condition['shop_id'])) { |
@@ -401,6 +403,7 @@ class SearchController extends AbstractAction | @@ -401,6 +403,7 @@ class SearchController extends AbstractAction | ||
401 | 'gender' => FILTER_DEFAULT, | 403 | 'gender' => FILTER_DEFAULT, |
402 | 'channel' => FILTER_DEFAULT, | 404 | 'channel' => FILTER_DEFAULT, |
403 | 'ageLevel' => FILTER_DEFAULT, | 405 | 'ageLevel' => FILTER_DEFAULT, |
406 | + 'students' => FILTER_DEFAULT, | ||
404 | 'p_d' => FILTER_DEFAULT,), false); | 407 | 'p_d' => FILTER_DEFAULT,), false); |
405 | 408 | ||
406 | // 转义分类 | 409 | // 转义分类 |
@@ -103,6 +103,9 @@ class SearchModel | @@ -103,6 +103,9 @@ class SearchModel | ||
103 | } else if (isset($condition['sort'])) { | 103 | } else if (isset($condition['sort'])) { |
104 | $listData = ClassData::filterClassData($condition); | 104 | $listData = ClassData::filterClassData($condition); |
105 | $exclude = 'group_sort'; | 105 | $exclude = 'group_sort'; |
106 | + } else if (isset($condition['students'])) { | ||
107 | + $listData = ClassData::filterStudentsData($condition); | ||
108 | + $exclude = 'students'; | ||
106 | } else { | 109 | } else { |
107 | $listData = SearchData::searchByCondition($condition); | 110 | $listData = SearchData::searchByCondition($condition); |
108 | $exclude = null; | 111 | $exclude = null; |
@@ -11,8 +11,8 @@ define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录 | @@ -11,8 +11,8 @@ define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录 | ||
11 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录 | 11 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录 |
12 | defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer'); | 12 | defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer'); |
13 | 13 | ||
14 | -define('API_URL', 'http://api.yoho.cn/'); | ||
15 | -define('SERVICE_URL', 'http://service.yoho.cn/'); | 14 | +define('API_URL', 'http://api-test3.yohops.com:9999/'); |
15 | +define('SERVICE_URL', 'http://service-test3.yohops.com:9999/'); | ||
16 | define('YOHOBUY_URL', 'http://www.yohobuy.com/'); | 16 | define('YOHOBUY_URL', 'http://www.yohobuy.com/'); |
17 | define('SERVICE_NOTIFY', 'http://testservice.yoho.cn:28077/'); | 17 | define('SERVICE_NOTIFY', 'http://testservice.yoho.cn:28077/'); |
18 | 18 |
@@ -11,8 +11,8 @@ define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录 | @@ -11,8 +11,8 @@ define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录 | ||
11 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录 | 11 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录 |
12 | defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'testing'); | 12 | defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'testing'); |
13 | 13 | ||
14 | -define('API_URL', 'http://testapi.yoho.cn:28078/'); | ||
15 | -define('SERVICE_URL', 'http://testservice.yoho.cn:28077/'); | 14 | +define('API_URL', 'http://api-test3.yohops.com:9999/'); |
15 | +define('SERVICE_URL', 'http://service-test3.yohops.com:9999/'); | ||
16 | define('YOHOBUY_URL', 'http://www.yohobuy.com/'); | 16 | define('YOHOBUY_URL', 'http://www.yohobuy.com/'); |
17 | define('SERVICE_NOTIFY', 'http://testservice.yoho.cn:28077/'); | 17 | define('SERVICE_NOTIFY', 'http://testservice.yoho.cn:28077/'); |
18 | 18 |
-
Please register or login to post a comment