作者 lyh

gx

@@ -114,14 +114,10 @@ class BTemplateLogic extends BaseLogic @@ -114,14 +114,10 @@ class BTemplateLogic extends BaseLogic
114 $condition = ['common_type'=>BTemplate::COMMON_HEAD,'source'=>'','is_list'=>$is_list,'is_custom'=>$is_custom,'template_id'=>$template_id]; 114 $condition = ['common_type'=>BTemplate::COMMON_HEAD,'source'=>'','is_list'=>$is_list,'is_custom'=>$is_custom,'template_id'=>$template_id];
115 $headComInfo = $this->getHeadComHtml($condition,$source,$is_list,$is_custom,$template_id); 115 $headComInfo = $this->getHeadComHtml($condition,$source,$is_list,$is_custom,$template_id);
116 $bTemplateComModel = new BTemplateCom(); 116 $bTemplateComModel = new BTemplateCom();
117 - $condition['common_type'] = BTemplate::COMMON_OTHER;  
118 - $condition['source'] = $headComInfo['source'];  
119 - $condition['is_list'] = $headComInfo['is_list'];  
120 - $otherInfo = $bTemplateComModel->read($condition); 117 + $otherInfo = $bTemplateComModel->read(['source'=>$headComInfo['source'],'common_type'=>BTemplate::COMMON_OTHER,'is_list'=>$headComInfo['is_list'],'is_custom'=>$headComInfo['is_custom']]);
121 if($otherInfo === false){ 118 if($otherInfo === false){
122 $this->fail('获取失败,请联系管理员222'); 119 $this->fail('获取失败,请联系管理员222');
123 } 120 }
124 - $condition['is_list'] = $is_list;  
125 $footerComInfo = $this->getFooterComHtml($condition,$source,$is_list,$is_custom,$template_id); 121 $footerComInfo = $this->getFooterComHtml($condition,$source,$is_list,$is_custom,$template_id);
126 $data = ['head_html'=>$headComInfo['html'] ?? '', 'head_style'=>$headComInfo['html_style'] ?? '', 'other'=>$otherInfo['html'] ?? '', 122 $data = ['head_html'=>$headComInfo['html'] ?? '', 'head_style'=>$headComInfo['html_style'] ?? '', 'other'=>$otherInfo['html'] ?? '',
127 'footer_html'=>$footerComInfo['html'] ?? '','footer_style'=>$footerComInfo['html_style'] ?? '']; 123 'footer_html'=>$footerComInfo['html'] ?? '','footer_style'=>$footerComInfo['html_style'] ?? ''];
@@ -143,11 +139,9 @@ class BTemplateLogic extends BaseLogic @@ -143,11 +139,9 @@ class BTemplateLogic extends BaseLogic
143 $headComInfo = $bTemplateComModel->read($condition); 139 $headComInfo = $bTemplateComModel->read($condition);
144 if($headComInfo === false){ 140 if($headComInfo === false){
145 //取默认公共的 141 //取默认公共的
146 - $condition['source'] = BTemplate::SOURCE_COM;  
147 - $condition['is_list'] = BTemplate::IS_DETAIL;  
148 - $headComInfo = $bTemplateComModel->read($condition); 142 + $headComInfo = $bTemplateComModel->read(['source'=>BTemplate::SOURCE_COM,'common_type'=>BTemplate::COMMON_HEAD]);
149 if($headComInfo === false){ 143 if($headComInfo === false){
150 - $this->fail('获取失败,请联系管理员1111'); 144 + $this->fail('获取失败,请联系管理员111');
151 } 145 }
152 } 146 }
153 return $this->success($headComInfo); 147 return $this->success($headComInfo);
@@ -166,9 +160,7 @@ class BTemplateLogic extends BaseLogic @@ -166,9 +160,7 @@ class BTemplateLogic extends BaseLogic
166 $footerComInfo = $bTemplateComModel->read($condition); 160 $footerComInfo = $bTemplateComModel->read($condition);
167 if($footerComInfo === false){ 161 if($footerComInfo === false){
168 //取默认首页的 162 //取默认首页的
169 - $condition['source'] = BTemplate::SOURCE_COM;  
170 - $condition['is_list'] = BTemplate::IS_DETAIL;  
171 - $footerComInfo = $bTemplateComModel->read($condition); 163 + $footerComInfo = $bTemplateComModel->read(['source'=>BTemplate::SOURCE_COM,'common_type'=>BTemplate::COMMON_FOOTER]);
172 if($footerComInfo === false){ 164 if($footerComInfo === false){
173 $this->fail('获取失败,请联系管理员'); 165 $this->fail('获取失败,请联系管理员');
174 } 166 }
@@ -70,14 +70,10 @@ class InitHtmlLogic extends BaseLogic @@ -70,14 +70,10 @@ class InitHtmlLogic extends BaseLogic
70 $condition = ['common_type'=>BTemplate::COMMON_HEAD,'source'=>$source,'is_list'=>$is_list,'is_custom'=>$is_custom,'template_id'=>$template_id]; 70 $condition = ['common_type'=>BTemplate::COMMON_HEAD,'source'=>$source,'is_list'=>$is_list,'is_custom'=>$is_custom,'template_id'=>$template_id];
71 $headComInfo = $this->getHeadComHtml($condition,$source,$is_list,$is_custom,$template_id); 71 $headComInfo = $this->getHeadComHtml($condition,$source,$is_list,$is_custom,$template_id);
72 $bTemplateComModel = new BTemplateCom(); 72 $bTemplateComModel = new BTemplateCom();
73 - $condition['common_type'] = BTemplate::COMMON_OTHER;  
74 - $condition['source'] = $headComInfo['source'];  
75 - $condition['is_list'] = $headComInfo['is_list'];  
76 - $otherInfo = $bTemplateComModel->read($condition); 73 + $otherInfo = $bTemplateComModel->read(['source'=>$headComInfo['source'],'common_type'=>BTemplate::COMMON_OTHER,'is_list'=>$headComInfo['is_list'],'is_custom'=>$headComInfo['is_custom']]);
77 if($otherInfo === false){ 74 if($otherInfo === false){
78 $this->fail('获取失败,请联系管理员'); 75 $this->fail('获取失败,请联系管理员');
79 } 76 }
80 - $condition['is_list'] = $is_list;  
81 $footerComInfo = $this->getFooterComHtml($condition,$source,$is_list,$is_custom,$template_id); 77 $footerComInfo = $this->getFooterComHtml($condition,$source,$is_list,$is_custom,$template_id);
82 $data = ['head_html'=>$headComInfo['html'] ?? '', 'head_style'=>$headComInfo['html_style'] ?? '', 'other'=>$otherInfo['html'] ?? '', 78 $data = ['head_html'=>$headComInfo['html'] ?? '', 'head_style'=>$headComInfo['html_style'] ?? '', 'other'=>$otherInfo['html'] ?? '',
83 'footer_html'=>$footerComInfo['html'] ?? '','footer_style'=>$footerComInfo['html_style'] ?? '']; 79 'footer_html'=>$footerComInfo['html'] ?? '','footer_style'=>$footerComInfo['html_style'] ?? ''];
@@ -99,9 +95,7 @@ class InitHtmlLogic extends BaseLogic @@ -99,9 +95,7 @@ class InitHtmlLogic extends BaseLogic
99 $headComInfo = $bTemplateComModel->read($condition); 95 $headComInfo = $bTemplateComModel->read($condition);
100 if($headComInfo === false){ 96 if($headComInfo === false){
101 //取默认公共的 97 //取默认公共的
102 - $condition['source'] = BTemplate::SOURCE_COM;  
103 - $condition['is_list'] = 0;  
104 - $headComInfo = $bTemplateComModel->read($condition); 98 + $headComInfo = $bTemplateComModel->read(['source'=>BTemplate::SOURCE_COM,'common_type'=>BTemplate::COMMON_HEAD]);
105 if($headComInfo === false){ 99 if($headComInfo === false){
106 $this->fail('获取失败,请联系管理员'); 100 $this->fail('获取失败,请联系管理员');
107 } 101 }
@@ -122,9 +116,7 @@ class InitHtmlLogic extends BaseLogic @@ -122,9 +116,7 @@ class InitHtmlLogic extends BaseLogic
122 $footerComInfo = $bTemplateComModel->read($condition); 116 $footerComInfo = $bTemplateComModel->read($condition);
123 if($footerComInfo === false){ 117 if($footerComInfo === false){
124 //取默认首页的 118 //取默认首页的
125 - $condition['source'] = BTemplate::SOURCE_COM;  
126 - $condition['is_list'] = 0;  
127 - $footerComInfo = $bTemplateComModel->read($condition); 119 + $footerComInfo = $bTemplateComModel->read(['source'=>BTemplate::SOURCE_COM,'common_type'=>BTemplate::COMMON_FOOTER]);
128 if($footerComInfo === false){ 120 if($footerComInfo === false){
129 $this->fail('获取失败,请联系管理员'); 121 $this->fail('获取失败,请联系管理员');
130 } 122 }