|
@@ -259,46 +259,44 @@ class AdService implements AdServiceInterface
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
if(array_key_exists( $page,$oldtemplate_data['template'])){
|
|
if(array_key_exists( $page,$oldtemplate_data['template'])){
|
|
|
- $ad_places_info = $oldtemplate_data['template'][$page];
|
|
|
|
|
- }
|
|
|
|
|
- foreach($ad_places_info as $key=>$val){
|
|
|
|
|
- $ad_info[$key] = $val;
|
|
|
|
|
- if(array_key_exists('ad',$val) && $val['ad']['ad_tag'] == $template_data['ad_tag']){
|
|
|
|
|
- $ad_info[$key]['ad'] = $template_ad;
|
|
|
|
|
- $num = $key;
|
|
|
|
|
|
|
+ $ad_places_info = $oldtemplate_data['template'][$page];
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- $canvas_data = $oldcanvas_data;
|
|
|
|
|
- foreach($oldcanvas_data['template'][$page] as $key=>$val){
|
|
|
|
|
- // $canvas_info_ad[$key] = $val;
|
|
|
|
|
- if(array_key_exists('ad',$val['content']) && $val['content']['ad']['ad_tag'] == $template_data['ad_tag']){
|
|
|
|
|
- // $canvas_info_ad[$key]['ad'] = $template_ad;
|
|
|
|
|
- $canvas_ad['content']['ad'] = [
|
|
|
|
|
- 'width' => $val['content']['ad']['width'],
|
|
|
|
|
- 'height' => $val['content']['ad']['height'],
|
|
|
|
|
- 'name'=>$template_data['name'], //广告位名称可更改
|
|
|
|
|
- 'price'=>$template_data['price'], //广告位价格可更改
|
|
|
|
|
- 'introduce'=>$template_data['introduce'], //广告位介绍可更改
|
|
|
|
|
- 'website_id'=>$val['content']['ad']['website_id'],
|
|
|
|
|
- 'thumb'=>$val['content']['ad']['thumb'], //广告位默认图可更改
|
|
|
|
|
- 'typeid'=>$val['content']['ad']['typeid'],
|
|
|
|
|
- 'ad_tag'=>$val['content']['ad']['ad_tag'],
|
|
|
|
|
- ];
|
|
|
|
|
- $canvas_data['template'][$page][$key]['content'] = $canvas_ad['content'];
|
|
|
|
|
|
|
+ foreach($ad_places_info as $key=>$val){
|
|
|
|
|
+ $ad_info[$key] = $val;
|
|
|
|
|
+ if(array_key_exists('ad',$val) && $val['ad']['ad_tag'] == $template_data['ad_tag']){
|
|
|
|
|
+ $ad_info[$key]['ad'] = $template_ad;
|
|
|
|
|
+ $num = $key;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ $canvas_data = $oldcanvas_data;
|
|
|
|
|
+ foreach($oldcanvas_data['template'][$page] as $key=>$val){
|
|
|
|
|
+ // $canvas_info_ad[$key] = $val;
|
|
|
|
|
+ if(array_key_exists('ad',$val['content']) && $val['content']['ad']['ad_tag'] == $template_data['ad_tag']){
|
|
|
|
|
+ // $canvas_info_ad[$key]['ad'] = $template_ad;
|
|
|
|
|
+ $canvas_ad['content']['ad'] = [
|
|
|
|
|
+ 'width' => $val['content']['ad']['width'],
|
|
|
|
|
+ 'height' => $val['content']['ad']['height'],
|
|
|
|
|
+ 'name'=>$template_data['name'], //广告位名称可更改
|
|
|
|
|
+ 'price'=>$template_data['price'], //广告位价格可更改
|
|
|
|
|
+ 'introduce'=>$template_data['introduce'], //广告位介绍可更改
|
|
|
|
|
+ 'website_id'=>$val['content']['ad']['website_id'],
|
|
|
|
|
+ 'thumb'=>$val['content']['ad']['thumb'], //广告位默认图可更改
|
|
|
|
|
+ 'typeid'=>$val['content']['ad']['typeid'],
|
|
|
|
|
+ 'ad_tag'=>$val['content']['ad']['ad_tag'],
|
|
|
|
|
+ ];
|
|
|
|
|
+ $canvas_data['template'][$page][$key]['content']['ad'] = $canvas_ad['content']['ad'];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ $oldtemplate_data['template'][$page] = $ad_info; //模板广告位相关信息已修改
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- $oldtemplate_data['template'][$page] = $ad_info; //模板广告位相关信息已修改
|
|
|
|
|
- }
|
|
|
|
|
// return Result::success($ad_place);
|
|
// return Result::success($ad_place);
|
|
|
|
|
|
|
|
// 保存的模板中的广告位相关信息
|
|
// 保存的模板中的广告位相关信息
|
|
|
- $oldtemplate_data['ad'][$page] = $ad_place;
|
|
|
|
|
|
|
+ $oldtemplate_data['ad'][$page] = $ad_place;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- // Db::rollBack();
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // Db::rollBack();
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
|
|
|
|
if($page == 'top'){
|
|
if($page == 'top'){
|