...
|
...
|
@@ -591,19 +591,33 @@ class ShopModel |
|
|
* @param type string $tag 搜索内容
|
|
|
* @return array []
|
|
|
*/
|
|
|
public static function getArticle($tag = '')
|
|
|
public static function getArticle($shopId)
|
|
|
{
|
|
|
$result = array();
|
|
|
if (empty($tag)) {
|
|
|
$articleData = array();
|
|
|
$brands = self::getShopsBrands($shopId);
|
|
|
if (empty($brands)) {
|
|
|
return $result;
|
|
|
}
|
|
|
foreach ($brands as $val) {
|
|
|
$article = GuangListData::getArticleByBrand($val['brand_id'], 3);
|
|
|
if (!empty($article['data'])) {
|
|
|
$articleData = array_merge($articleData, $article['data']);
|
|
|
}
|
|
|
|
|
|
if (count($articleData) > 3) {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$article = GuangListData::article('1,2,3', 0, 0, '', 0, $tag, '', 3);
|
|
|
if (empty($article['data']['list']['artList'])) {
|
|
|
if (empty($articleData)) {
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
foreach ($article['data']['list']['artList'] as $artList) {
|
|
|
foreach ($articleData as $key => $artList) {
|
|
|
if ($key >= 3) {
|
|
|
break;
|
|
|
}
|
|
|
$result['trendList'][] = array(
|
|
|
'href' => $artList['url'],
|
|
|
'src' => self::imageView2(substr($artList['src'], 0, strpos($artList['src'], '?')), 264, 173),
|
...
|
...
|
@@ -611,7 +625,7 @@ class ShopModel |
|
|
'Subtitle' => $artList['intro']
|
|
|
);
|
|
|
}
|
|
|
|
|
|
//等于3个才显示
|
|
|
if (count($result['trendList']) < 3) {
|
|
|
return array();
|
|
|
}
|
...
|
...
|
|