...
|
...
|
@@ -30,15 +30,22 @@ class CouponFloorProcess |
|
|
|
|
|
$build = array();
|
|
|
foreach ($data as $k => &$v) {
|
|
|
$fun = '';
|
|
|
if (empty($v) || !is_array($v) || !array_key_exists('template_name', $v)) {
|
|
|
if (array_key_exists('templateName', $v)) {
|
|
|
$fun = $v['templateName'];
|
|
|
} else {
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
if ($fun !== 'single_image') {
|
|
|
$fun = $v['template_name'];
|
|
|
}
|
|
|
if (empty($v['data']) || !is_callable("self::$fun")) {
|
|
|
continue;
|
|
|
}
|
|
|
// tar note 处理楼层标题
|
|
|
if ($fun === 'getCoupon' && $data[$k - 1]['template_name'] === 'text') {
|
|
|
if ($fun === 'getCoupon' && array_key_exists('template_name', $data[$k - 1]) && $data[$k - 1]['template_name'] === 'text') {
|
|
|
$v['data']['floorTitle'] = $data[$k - 1]['data'];
|
|
|
}
|
|
|
$build = self::$fun($v['data']);
|
...
|
...
|
@@ -63,8 +70,10 @@ class CouponFloorProcess |
|
|
return array();
|
|
|
}
|
|
|
foreach ($data['list'] as &$item) {
|
|
|
$imageSrc = Images::getImageUrl($item['src'], 0, 0);
|
|
|
$item['src'] = $imageSrc;
|
|
|
$item['img'] = Images::getImageUrl($item['src'], 0, 0);
|
|
|
if (!is_string($item['url'])) {
|
|
|
$item['url'] = '';
|
|
|
}
|
|
|
}
|
|
|
$data['isCarouselBanner'] = true;
|
|
|
return $data;
|
...
|
...
|
@@ -132,14 +141,15 @@ class CouponFloorProcess |
|
|
|
|
|
/**
|
|
|
*
|
|
|
* 单张图片的处理方法,不用
|
|
|
* 单张图片的处理方法
|
|
|
*
|
|
|
* @param $data
|
|
|
* @return mixed
|
|
|
*/
|
|
|
private static function single_image($data)
|
|
|
{
|
|
|
$data['isSingleImage'] = true;
|
|
|
return $data;
|
|
|
$data[0]['src'] = Images::getImageUrl($data[0]['src'], 0, 0);
|
|
|
$data[0]['isSingleImage'] = true;
|
|
|
return $data[0];
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|