|
...
|
...
|
@@ -11,6 +11,7 @@ use App\Models\RouteMap\RouteMap; |
|
|
|
use App\Models\Service\Service as ServiceSettingModel;
|
|
|
|
use App\Models\Template\BSetting;
|
|
|
|
use App\Models\Template\BTemplate;
|
|
|
|
use App\Models\Template\BTemplateLog;
|
|
|
|
use App\Models\Template\Template;
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -172,16 +173,18 @@ class BTemplateLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function templateSave(){
|
|
|
|
//查询当前模版是否已保存
|
|
|
|
try {
|
|
|
|
$info = $this->webTemplateInfo($this->param['template_id'],$this->param['source'],$this->param['source_id']);
|
|
|
|
//字符串截取
|
|
|
|
$this->param = $this->stringProcessing($this->param);
|
|
|
|
$this->param = $this->templateSaveParam($this->param);
|
|
|
|
if($info === false){
|
|
|
|
$rs = $this->model->add($this->param);
|
|
|
|
$this->model->add($this->param);
|
|
|
|
}else{
|
|
|
|
$rs = $this->model->edit($this->param,['id'=>$info['id']]);
|
|
|
|
$this->model->edit($this->param,['id'=>$info['id']]);
|
|
|
|
}
|
|
|
|
if($rs === false){
|
|
|
|
$this->setTemplateLog($this->param);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('error');
|
|
|
|
}
|
|
|
|
//通知更新
|
|
...
|
...
|
@@ -190,6 +193,24 @@ class BTemplateLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :生成记录
|
|
|
|
* @name :setTemplateLog
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/23 11:16
|
|
|
|
*/
|
|
|
|
public function setTemplateLog($param){
|
|
|
|
$data = [
|
|
|
|
'template_id'=>$param['template_id'],
|
|
|
|
'project_id'=>$this->user['project_id'],
|
|
|
|
'operator_id'=>$this->user['id'],
|
|
|
|
'text'=>$param['html'],
|
|
|
|
];
|
|
|
|
$bTemplateLogModel = new BTemplateLog();
|
|
|
|
return $bTemplateLogModel->add($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :通知首页更新
|
|
|
|
* @name :IsHome
|
|
|
|
* @author :lyh
|
...
|
...
|
|