...
|
...
|
@@ -4,9 +4,10 @@ namespace LibModels\Wap\Guang; |
|
|
|
|
|
use Api\Sign;
|
|
|
use Api\Yohobuy;
|
|
|
use Plugin\Helpers;
|
|
|
use Configs\CacheConfig;
|
|
|
use Plugin\Helpers;
|
|
|
use Plugin\Cache;
|
|
|
use LibModels\Wap\Product\SearchData;
|
|
|
|
|
|
/**
|
|
|
* 明星品牌和原创品牌相关的数据模型
|
...
|
...
|
@@ -19,7 +20,6 @@ use Plugin\Cache; |
|
|
*/
|
|
|
class PlusstarData
|
|
|
{
|
|
|
|
|
|
const URI_BRANDLIST = 'guang/api/v1/plustar/getlist';
|
|
|
const URI_BRANDINFO_PLUSSTAR = 'guang/service/v1/plustar/';
|
|
|
const URI_BRANDINFO_FAVORITE = 'shops/service/v1/favorite/';
|
...
|
...
|
@@ -127,7 +127,7 @@ class PlusstarData |
|
|
$result['getArticleByBrand'] = array();
|
|
|
|
|
|
$key = CacheConfig::KEY_ACTION_GUANG_PLUSTAR_DATA . strval($id);
|
|
|
|
|
|
|
|
|
// 品牌详情信息
|
|
|
$brandInfo = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_PLUSSTAR, 'getBrandInfo', array(array('id' => $id)), 3600); // 缓存1小时
|
|
|
if (!isset($brandInfo['data']['brand_id'])) {
|
...
|
...
|
@@ -162,16 +162,24 @@ class PlusstarData |
|
|
$result['getUidProductFav'] = array();
|
|
|
|
|
|
do {
|
|
|
// 调用搜索接口
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.search.li';
|
|
|
$param['brand'] = $brandInfo['data']['brand_id'];
|
|
|
$param['page'] = '0';
|
|
|
$param['limit'] = '6';
|
|
|
$param['gender'] = $gender;
|
|
|
$param['order'] = 's_t_desc';
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
$newProduct = Yohobuy::get(Yohobuy::API_URL, $param, 1800); // 缓存30分钟
|
|
|
// // 调用搜索接口
|
|
|
// $param = Yohobuy::param();
|
|
|
// $param['method'] = 'app.search.li';
|
|
|
// $param['brand'] = $brandInfo['data']['brand_id'];
|
|
|
// $param['page'] = '0';
|
|
|
// $param['limit'] = '6';
|
|
|
// $param['gender'] = $gender;
|
|
|
// $param['order'] = 's_t_desc';
|
|
|
// $param['client_secret'] = Sign::getSign($param);
|
|
|
// $newProduct = Yohobuy::get(Yohobuy::API_URL, $param, 1800); // 缓存30分钟
|
|
|
|
|
|
$condition = array();
|
|
|
$condition['brand'] = $brandInfo['data']['brand_id'];
|
|
|
$condition['gender'] = $gender;
|
|
|
$condition['limit'] = 6;
|
|
|
$condition['order'] = 's_t_desc';
|
|
|
$newProduct = SearchData::searchElasticByCondition($condition, 1800); // 有缓存30分钟
|
|
|
|
|
|
if (empty($newProduct['data']['product_list'])) {
|
|
|
break;
|
|
|
}
|
...
|
...
|
|