Authored by 周少峰

students product lists

... ... @@ -111,4 +111,27 @@ class ClassData
return Yohobuy::get(API_URL, $param);
}
/**
* 学生专享商品
*
*/
public static function filterStudentsData($condition)
{
$param = Yohobuy::param();
$param['method'] = 'app.student.discount';
$param += $condition;
if (!isset($param['order'])) {
$param['order'] = 's_t_desc';
}
if (!isset($param['limit'])) {
$param['limit'] = 60;
}
if (!isset($param['page'])) {
$param['page'] = 1;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(API_URL, $param);
}
}
... ...
... ... @@ -177,6 +177,11 @@ class SearchData
$param['ageLevel'] = $param['age_level'];
unset($param['age_level']);
}
if (isset($param['students'])) {
$param['isStudentPrice'] = 'N';
$param['vdt'] = 1;
unset($param['students']);
}
return Yohobuy::get(self::getSearchUrl(), $param, $cache);
}
... ...
... ... @@ -76,4 +76,7 @@
{{#if outlets}}
<input class="query-param" type="hidden" data-attr="outlets" value="{{outlets}}">
{{/if}}
{{#if students}}
<input class="query-param" type="hidden" data-attr="students" value="{{students}}">
{{/if}}
\ No newline at end of file
... ...
... ... @@ -62,6 +62,7 @@ class SearchController extends AbstractAction
'channel' => FILTER_DEFAULT,
'outlets' => FILTER_DEFAULT,
'ageLevel' => FILTER_DEFAULT,
'students' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
if (isset($condition['shop_id'])) {
$condition['shopId'] = $condition['shop_id'];
... ... @@ -80,7 +81,7 @@ class SearchController extends AbstractAction
}
// 标识用户是否有输入搜索内容
$haveQuery = $query !== '';
$haveQuery = $query;
// 标识用户搜的是不是一级品类
$isQueryFirstClass = false;
// 标识用户搜的是不是二级品类
... ... @@ -252,6 +253,7 @@ class SearchController extends AbstractAction
'p_d' => FILTER_DEFAULT,
'outlets' => FILTER_DEFAULT,
'age_level' => FILTER_DEFAULT,
'students' => FILTER_DEFAULT,
'page' => FILTER_VALIDATE_INT,), false);
if (!empty($condition['shop_id'])) {
... ... @@ -401,6 +403,7 @@ class SearchController extends AbstractAction
'gender' => FILTER_DEFAULT,
'channel' => FILTER_DEFAULT,
'ageLevel' => FILTER_DEFAULT,
'students' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
// 转义分类
... ...
... ... @@ -103,6 +103,9 @@ class SearchModel
} else if (isset($condition['sort'])) {
$listData = ClassData::filterClassData($condition);
$exclude = 'group_sort';
} else if (isset($condition['students'])) {
$listData = ClassData::filterStudentsData($condition);
$exclude = 'students';
} else {
$listData = SearchData::searchByCondition($condition);
$exclude = null;
... ...
... ... @@ -11,8 +11,8 @@ define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer');
define('API_URL', 'http://api.yoho.cn/');
define('SERVICE_URL', 'http://service.yoho.cn/');
define('API_URL', 'http://api-test3.yohops.com:9999/');
define('SERVICE_URL', 'http://service-test3.yohops.com:9999/');
define('YOHOBUY_URL', 'http://www.yohobuy.com/');
define('SERVICE_NOTIFY', 'http://testservice.yoho.cn:28077/');
... ...
... ... @@ -11,8 +11,8 @@ define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'testing');
define('API_URL', 'http://testapi.yoho.cn:28078/');
define('SERVICE_URL', 'http://testservice.yoho.cn:28077/');
define('API_URL', 'http://api-test3.yohops.com:9999/');
define('SERVICE_URL', 'http://service-test3.yohops.com:9999/');
define('YOHOBUY_URL', 'http://www.yohobuy.com/');
define('SERVICE_NOTIFY', 'http://testservice.yoho.cn:28077/');
... ...