作者 lyh

gx

@@ -504,7 +504,6 @@ class BTemplateLogic extends BaseLogic @@ -504,7 +504,6 @@ class BTemplateLogic extends BaseLogic
504 public function saveTemplateCom($html,$template_id,$source,$is_list,$is_custom){ 504 public function saveTemplateCom($html,$template_id,$source,$is_list,$is_custom){
505 $typeArr = [BTemplate::COMMON_HEAD, BTemplate::COMMON_FOOTER, BTemplate::COMMON_OTHER]; 505 $typeArr = [BTemplate::COMMON_HEAD, BTemplate::COMMON_FOOTER, BTemplate::COMMON_OTHER];
506 $handleInfo = $this->handleCommonParam($html); 506 $handleInfo = $this->handleCommonParam($html);
507 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($handleInfo, true) . PHP_EOL, FILE_APPEND);  
508 $templateComModel = new BTemplateCom(); 507 $templateComModel = new BTemplateCom();
509 foreach ($typeArr as $type){ 508 foreach ($typeArr as $type){
510 if($type == BTemplate::COMMON_HEAD){ 509 if($type == BTemplate::COMMON_HEAD){
@@ -523,11 +522,10 @@ class BTemplateLogic extends BaseLogic @@ -523,11 +522,10 @@ class BTemplateLogic extends BaseLogic
523 $condition = ['project_id'=>$this->user['project_id'],'template_id'=>$template_id,'is_list'=>$is_list,'is_custom'=>$is_custom,'source'=>$typeSource,'common_type'=>$type]; 522 $condition = ['project_id'=>$this->user['project_id'],'template_id'=>$template_id,'is_list'=>$is_list,'is_custom'=>$is_custom,'source'=>$typeSource,'common_type'=>$type];
524 $info = $templateComModel->read($condition); 523 $info = $templateComModel->read($condition);
525 if($info === false){ 524 if($info === false){
526 - $param = array_merge($param,$condition);  
527 - $templateComModel->add($param); 525 + $data = array_merge($param,$condition);
  526 + $templateComModel->add($data);
528 }else{ 527 }else{
529 $templateComModel->edit($param,$condition); 528 $templateComModel->edit($param,$condition);
530 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($condition, true) . PHP_EOL, FILE_APPEND);  
531 } 529 }
532 } 530 }
533 return $this->success(); 531 return $this->success();