...
|
...
|
@@ -3,6 +3,7 @@ |
|
|
namespace Plugin\DataProcess;
|
|
|
|
|
|
use Plugin\Helpers;
|
|
|
use Plugin\Images;
|
|
|
|
|
|
/**
|
|
|
* 店铺楼层数据处理类
|
...
|
...
|
@@ -25,7 +26,6 @@ class ShopProcess |
|
|
}
|
|
|
self::$key($val);
|
|
|
}
|
|
|
// print_r($data);
|
|
|
// exit;
|
|
|
return self::$shopData;
|
|
|
}
|
...
|
...
|
@@ -51,36 +51,43 @@ class ShopProcess |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 店铺基本信息
|
|
|
* @param $data
|
|
|
*/
|
|
|
private static function shopInfo($data)
|
|
|
{
|
|
|
self::$shopData['logoImg'] = Images::getImageUrl($data['data']['shop_logo'], 500, 500, 'shopLogo');
|
|
|
self::$shopData['storeName'] = $data['data']['shop_name'];
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 店铺Banner
|
|
|
* @param array $data
|
|
|
* @author sefon 2016-4-27 08:40:05
|
|
|
* @return array
|
|
|
*/
|
|
|
private static function shopTopBanner($data)
|
|
|
private static function shopTopBanner_APP($data)
|
|
|
{
|
|
|
foreach ($data as $val) {
|
|
|
self::$shopData['bannerTop']['list'][] = array('url' => '', 'img' => $val['shopSrc']);
|
|
|
}
|
|
|
self::$shopData['branerImg'] = $data[0]['shopSrc'];
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 资源位小图
|
|
|
* 资源位小图 接口返回两组,取每组第一张
|
|
|
* @param array $data
|
|
|
* @author sefon 2016-4-27 08:37:30
|
|
|
* @return array
|
|
|
*/
|
|
|
private static function oneRowTwoColImages($data)
|
|
|
private static function oneRowTwoColImages_APP($data)
|
|
|
{
|
|
|
// print_r($data); exit;
|
|
|
foreach ($data as $key => $val) {
|
|
|
if (empty($val['data'])) {
|
|
|
continue;
|
|
|
}
|
|
|
foreach ($val['data'] as $val) {
|
|
|
self::$shopData['spring'][] = array(
|
|
|
'url' => $val['url'],
|
|
|
'springType' => $val['src']
|
|
|
);
|
|
|
}
|
|
|
self::$shopData['spring'][$key] = array(
|
|
|
'url' => $val['data'][0]['url'],
|
|
|
'springType' => $val['data'][0]['src']
|
|
|
);
|
|
|
}
|
|
|
return $data;
|
|
|
}
|
...
|
...
|
@@ -93,24 +100,45 @@ class ShopProcess |
|
|
*/
|
|
|
private static function brandBrowse($data)
|
|
|
{
|
|
|
// print_r($data); exit;
|
|
|
foreach ($data as $val) {
|
|
|
self::$shopData['multi-list'][] = array(
|
|
|
'url' => '',
|
|
|
'img' => $val['brandIco'],
|
|
|
self::$shopData['multiList'][] = array(
|
|
|
'url' => Helpers::url('', '', $val['brandDomain']),
|
|
|
'img' => Images::getImageUrl($val['brandIco'], 640, 400),
|
|
|
'brandName' => $val['brandName']
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 资源位大图幻灯
|
|
|
* @param $data
|
|
|
* @author sefon 2016-4-27 16:50:01
|
|
|
*/
|
|
|
private static function largeSlideImg($data)
|
|
|
{
|
|
|
// print_r($data); exit;
|
|
|
foreach ($data as $val) {
|
|
|
if (!isset($data['data']) || !empty($data['data'])) {
|
|
|
continue;
|
|
|
}
|
|
|
foreach ($data['data'] as $slide) {
|
|
|
self::$shopData['bannerTop']['list'][] = array('url' => $slide['url'], 'img' => $slide['shopSrc']);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
* 热门分类
|
|
|
* @param array $data
|
|
|
* @author sefon 2016-4-27 08:38:36
|
|
|
* @return array
|
|
|
*/
|
|
|
private static function hotRecommend($data)
|
|
|
private static function recommend($data)
|
|
|
{
|
|
|
|
|
|
self::$shopData['hotCategory']['name'] = '热门品类';
|
|
|
foreach ($data as $cate) {
|
|
|
self::$shopData['hotCategory']['list'][] = array('url' => $cate['url'], 'img' => $cate['src']);
|
|
|
}
|
|
|
return $data;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -124,10 +152,10 @@ class ShopProcess |
|
|
{
|
|
|
// print_r($data);
|
|
|
foreach ($data as $val) {
|
|
|
echo $val['src'];
|
|
|
self::$shopData['hotList'][] = array(
|
|
|
'url' => $val['url'],
|
|
|
'img' => $val['src'],
|
|
|
'img' => Helpers::getImageUrl($val['src'], 235, 314),
|
|
|
'productName' => $val['productName'],
|
|
|
'salesPrice' => '¥'.$val['salesPrice'],
|
|
|
'presentPrice' => '¥'.$val['salesPrice']
|
|
|
);
|
...
|
...
|
@@ -136,4 +164,26 @@ class ShopProcess |
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 店铺下面的所有分类
|
|
|
* @author sefon 2016-4-27 21:40:28
|
|
|
*/
|
|
|
private static function shopCategory($data)
|
|
|
{
|
|
|
if (isset($data['code']) && $data['code'] == 200 && !empty($data['data'])) {
|
|
|
$total = count($data['data']);
|
|
|
if ($total > 5) {
|
|
|
self::$shopData['shopCategory']['url'] = 'http://m.yohobuy.com';
|
|
|
return;
|
|
|
}
|
|
|
foreach ($data['data'] as $key => $val) {
|
|
|
self::$shopData['shopCategory']['list'][] = array(
|
|
|
'url' => '',
|
|
|
'categoryId' => $val['category_id'],
|
|
|
'name' => $val['category_name']
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|