作者 邓超

xd

... ... @@ -123,7 +123,7 @@ class TemplateController extends BaseController
$data = TemplateLogic::instance()->first($source,$source_id);
return $this->response('',Code::SUCCESS,$data['html']);
return $this->response('',Code::SUCCESS,['html'=>$data['html']]);
}
... ... @@ -174,33 +174,33 @@ class TemplateController extends BaseController
* @time 2023/5/10 14:55
*/
public function customChunk(){
$html = $this->param['html']??[];
// 那个页面 的
$type = $this->param['type']??'';
if(!is_array($html)){
return $this->response('参数异常',Code::SYSTEM_ERROR);
}
// 项目id
$project_id = $this->user['project_id'];
// 当前模板
$template_id = BSetting::_get($project_id)['template_id'];
// 验证这个模板是否存在
if(!$type || !ATemplateHtml::_typeExist($template_id,$type)){
return $this->response('页面类型错误',Code::SYSTEM_ERROR);
}
$html = view("template.{$template_id}.{$type}")->render();
return $this->response('',Code::SUCCESS,$html);
// $data = BTemplateData::_insert();
//
// $html = $this->param['html']??[];
// // 那个页面 的
// $type = $this->param['type']??'';
//
// if(!is_array($html)){
// return $this->response('参数异常',Code::SYSTEM_ERROR);
// }
//
// // 项目id
// $project_id = $this->user['project_id'];
// // 当前模板
// $template_id = BSetting::_get($project_id)['template_id'];
//
// // 验证这个模板是否存在
// if(!$type || !ATemplateHtml::_typeExist($template_id,$type)){
// return $this->response('页面类型错误',Code::SYSTEM_ERROR);
// }
//
//
// $html = view("template.{$template_id}.{$type}")->render();
//
//
// return $this->response('',Code::SUCCESS,$html);
//// $data = BTemplateData::_insert();
//
//
}
... ...