|
@@ -22,21 +22,23 @@ class CmsContentTemplateSetRepository {
|
|
*/
|
|
*/
|
|
public function preview($request)
|
|
public function preview($request)
|
|
{
|
|
{
|
|
|
|
+ $temalates = $this->cmsContentTemplate->select('title','id')->where(['city_id'=>$request['city_id'],'apply_type'=>$request['type'],'is_open'=>0])->first();
|
|
|
|
+ if (!$temalates){
|
|
|
|
+ throw new HttpException(500, '没有找到对应模板');
|
|
|
|
+ }
|
|
|
|
+
|
|
//团购首页
|
|
//团购首页
|
|
$group_array = [];
|
|
$group_array = [];
|
|
if ($request['type'] == 0){
|
|
if ($request['type'] == 0){
|
|
$group_array['apply_type'] ="group";
|
|
$group_array['apply_type'] ="group";
|
|
|
|
+ $group_array['title'] =$temalates->title;
|
|
$group_array['content'] =[];
|
|
$group_array['content'] =[];
|
|
}else{//菜市场首页
|
|
}else{//菜市场首页
|
|
$group_array['apply_type'] ="market";
|
|
$group_array['apply_type'] ="market";
|
|
|
|
+ $group_array['title'] =$temalates->title;
|
|
$group_array['content'] =[];
|
|
$group_array['content'] =[];
|
|
}
|
|
}
|
|
|
|
|
|
- $temalates = $this->cmsContentTemplate->select('title','id')->where(['city_id'=>$request['city_id'],'apply_type'=>$request['type'],'is_open'=>0])->first();
|
|
|
|
- if (!$temalates){
|
|
|
|
- throw new HttpException(500, '没有找到对应模板');
|
|
|
|
- }
|
|
|
|
- $group_array['title'] =$temalates->title;
|
|
|
|
$group_array['content'][0]['area_type'] ="banner";
|
|
$group_array['content'][0]['area_type'] ="banner";
|
|
|
|
|
|
$banner_rule = $this->cmsContentTemplateSet->select('id','rule')->where(['tpl_id'=>$temalates->id,'area_type'=>0])->get();
|
|
$banner_rule = $this->cmsContentTemplateSet->select('id','rule')->where(['tpl_id'=>$temalates->id,'area_type'=>0])->get();
|