Showing
1 changed file
with
24 additions
and
1 deletions
@@ -13,6 +13,11 @@ use Plugin\Images; | @@ -13,6 +13,11 @@ use Plugin\Images; | ||
13 | 13 | ||
14 | class CouponFloorProcess | 14 | class CouponFloorProcess |
15 | { | 15 | { |
16 | + // 兼容驼峰规则命名的 template_name,此处是以 templateName 命名的数据 | ||
17 | + private static $TEMPLATE_LIST = array( | ||
18 | + 'single_image', | ||
19 | + 'focus' | ||
20 | + ); | ||
16 | 21 | ||
17 | /** | 22 | /** |
18 | * 获取楼层数据 | 23 | * 获取楼层数据 |
@@ -38,7 +43,7 @@ class CouponFloorProcess | @@ -38,7 +43,7 @@ class CouponFloorProcess | ||
38 | continue; | 43 | continue; |
39 | } | 44 | } |
40 | } | 45 | } |
41 | - if ($fun !== 'single_image') { | 46 | + if (!in_array($fun, self::$TEMPLATE_LIST)) { |
42 | $fun = $v['template_name']; | 47 | $fun = $v['template_name']; |
43 | } | 48 | } |
44 | if (empty($v['data']) || !is_callable("self::$fun")) { | 49 | if (empty($v['data']) || !is_callable("self::$fun")) { |
@@ -152,4 +157,22 @@ class CouponFloorProcess | @@ -152,4 +157,22 @@ class CouponFloorProcess | ||
152 | $data[0]['isSingleImage'] = true; | 157 | $data[0]['isSingleImage'] = true; |
153 | return $data[0]; | 158 | return $data[0]; |
154 | } | 159 | } |
160 | + | ||
161 | + /** | ||
162 | + * | ||
163 | + * 辅助方法 Debug 数据输出 | ||
164 | + * | ||
165 | + * @param $data | ||
166 | + * @param bool $is_exit 输出后是否中断执行 | ||
167 | + */ | ||
168 | + public static function debugOut($data, $is_exit = true) | ||
169 | + { | ||
170 | + header("Content-type:text/html;charset=utf-8"); | ||
171 | + echo '<pre>'; | ||
172 | + print_r($data); | ||
173 | + echo '</pre>'; | ||
174 | + if ($is_exit) { | ||
175 | + exit; | ||
176 | + } | ||
177 | + } | ||
155 | } | 178 | } |
-
Please register or login to post a comment