...
|
...
|
@@ -21,6 +21,7 @@ use Plugin\Cache; |
|
|
class NewsaleModel
|
|
|
{
|
|
|
/* 男生频道取新品到着及折扣专区数据的位置码 */
|
|
|
|
|
|
const CODE_TOP_NEW_BOYS = '3cf2c1be5217fbab6009ce83959e1e12';
|
|
|
const CODE_TOP_SALE_BOYS = '153180b9a88c0b565848850c523bb637';
|
|
|
/* 女生频道取新品到着及折扣专区数据的位置码 */
|
...
|
...
|
@@ -125,7 +126,6 @@ class NewsaleModel |
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取折扣专区的商品列表
|
|
|
*
|
...
|
...
|
@@ -162,7 +162,6 @@ class NewsaleModel |
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 顶部焦点图缓存控制
|
|
|
* @param const $cacheKey 缓存常量值
|
...
|
...
|
@@ -184,12 +183,12 @@ class NewsaleModel |
|
|
$newsale = NewsaleData::getNewsaleFocus($codeKey);
|
|
|
|
|
|
// 调用接口获取数据并封装
|
|
|
if (isset($newsale['code']) && isset($newsale['data'][0]['data'])) {
|
|
|
if(count($newsale['data'][0]['data']) === 1) {
|
|
|
$result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);
|
|
|
if (isset($newsale['code']) && isset($newsale['data']['list'])) {
|
|
|
if (count($newsale['data']['list']) === 1) {
|
|
|
$result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240);
|
|
|
} else {
|
|
|
foreach ($newsale['data'][0]['data'] as $one) {
|
|
|
$result['list'][] = Helpers::formatBanner($one, 640, 240);
|
|
|
foreach ($newsale['data']['list'] as $one) {
|
|
|
$result['list'][] = Helpers::formatBanner($one['data'], 640, 240);
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -217,41 +216,40 @@ class NewsaleModel |
|
|
public static function selectData($data)
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
|
|
|
if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) {
|
|
|
foreach ($data['data']['product_list'] as $val) {
|
|
|
$result['goods'][] = Helpers::formatProduct($val, true, false, false, 299,388);
|
|
|
$result['goods'][] = Helpers::formatProduct($val, true, false, false, 299, 388);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 筛选出来的热销排行榜商品数据处理
|
|
|
*
|
|
|
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
|
|
|
* @param string|null $sort 品类ID查询参数
|
|
|
* @param integer|null $tab_id Tab的ID
|
|
|
* @param boolean $notab 时候返回顶部tab的数据,默认返回
|
|
|
* @param integer $limit 查询返回的最大限制数
|
|
|
* @param integer $page 分页第几页
|
|
|
* @return array 处理之后的数据
|
|
|
*/
|
|
|
/**
|
|
|
* 筛选出来的热销排行榜商品数据处理
|
|
|
*
|
|
|
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
|
|
|
* @param string|null $sort 品类ID查询参数
|
|
|
* @param integer|null $tab_id Tab的ID
|
|
|
* @param boolean $notab 时候返回顶部tab的数据,默认返回
|
|
|
* @param integer $limit 查询返回的最大限制数
|
|
|
* @param integer $page 分页第几页
|
|
|
* @return array 处理之后的数据
|
|
|
*/
|
|
|
public static function selectTopData($gender, $sort, $tab_id, $notab, $limit, $page)
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
$data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);
|
|
|
$data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);
|
|
|
|
|
|
if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) {
|
|
|
$result = NewSaleProcess::topData($data['data'], $notab, $limit, $page);
|
|
|
$result = NewSaleProcess::topData($data['data'], $notab, $limit, $page);
|
|
|
}
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取筛选数据
|
|
|
* @param array $data 接口返回的数据
|
...
|
...
|
@@ -269,4 +267,5 @@ class NewsaleModel |
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|