|
@@ -11,6 +11,7 @@ use App\Models\RouteMap\RouteMap; |
|
@@ -11,6 +11,7 @@ use App\Models\RouteMap\RouteMap; |
|
11
|
use App\Models\Service\Service as ServiceSettingModel;
|
11
|
use App\Models\Service\Service as ServiceSettingModel;
|
|
12
|
use App\Models\Template\BSetting;
|
12
|
use App\Models\Template\BSetting;
|
|
13
|
use App\Models\Template\BTemplate;
|
13
|
use App\Models\Template\BTemplate;
|
|
|
|
14
|
+use App\Models\Template\BTemplateLog;
|
|
14
|
use App\Models\Template\Template;
|
15
|
use App\Models\Template\Template;
|
|
15
|
|
16
|
|
|
16
|
/**
|
17
|
/**
|
|
@@ -172,16 +173,18 @@ class BTemplateLogic extends BaseLogic |
|
@@ -172,16 +173,18 @@ class BTemplateLogic extends BaseLogic |
|
172
|
*/
|
173
|
*/
|
|
173
|
public function templateSave(){
|
174
|
public function templateSave(){
|
|
174
|
//查询当前模版是否已保存
|
175
|
//查询当前模版是否已保存
|
|
175
|
- $info = $this->webTemplateInfo($this->param['template_id'],$this->param['source'],$this->param['source_id']);
|
|
|
|
176
|
- //字符串截取
|
|
|
|
177
|
- $this->param = $this->stringProcessing($this->param);
|
|
|
|
178
|
- $this->param = $this->templateSaveParam($this->param);
|
|
|
|
179
|
- if($info === false){
|
|
|
|
180
|
- $rs = $this->model->add($this->param);
|
|
|
|
181
|
- }else{
|
|
|
|
182
|
- $rs = $this->model->edit($this->param,['id'=>$info['id']]);
|
|
|
|
183
|
- }
|
|
|
|
184
|
- if($rs === false){
|
176
|
+ try {
|
|
|
|
177
|
+ $info = $this->webTemplateInfo($this->param['template_id'],$this->param['source'],$this->param['source_id']);
|
|
|
|
178
|
+ //字符串截取
|
|
|
|
179
|
+ $this->param = $this->stringProcessing($this->param);
|
|
|
|
180
|
+ $this->param = $this->templateSaveParam($this->param);
|
|
|
|
181
|
+ if($info === false){
|
|
|
|
182
|
+ $this->model->add($this->param);
|
|
|
|
183
|
+ }else{
|
|
|
|
184
|
+ $this->model->edit($this->param,['id'=>$info['id']]);
|
|
|
|
185
|
+ }
|
|
|
|
186
|
+ $this->setTemplateLog($this->param);
|
|
|
|
187
|
+ }catch (\Exception $e){
|
|
185
|
$this->fail('error');
|
188
|
$this->fail('error');
|
|
186
|
}
|
189
|
}
|
|
187
|
//通知更新
|
190
|
//通知更新
|
|
@@ -190,6 +193,24 @@ class BTemplateLogic extends BaseLogic |
|
@@ -190,6 +193,24 @@ class BTemplateLogic extends BaseLogic |
|
190
|
}
|
193
|
}
|
|
191
|
|
194
|
|
|
192
|
/**
|
195
|
/**
|
|
|
|
196
|
+ * @remark :生成记录
|
|
|
|
197
|
+ * @name :setTemplateLog
|
|
|
|
198
|
+ * @author :lyh
|
|
|
|
199
|
+ * @method :post
|
|
|
|
200
|
+ * @time :2023/8/23 11:16
|
|
|
|
201
|
+ */
|
|
|
|
202
|
+ public function setTemplateLog($param){
|
|
|
|
203
|
+ $data = [
|
|
|
|
204
|
+ 'template_id'=>$param['template_id'],
|
|
|
|
205
|
+ 'project_id'=>$this->user['project_id'],
|
|
|
|
206
|
+ 'operator_id'=>$this->user['id'],
|
|
|
|
207
|
+ 'text'=>$param['html'],
|
|
|
|
208
|
+ ];
|
|
|
|
209
|
+ $bTemplateLogModel = new BTemplateLog();
|
|
|
|
210
|
+ return $bTemplateLogModel->add($data);
|
|
|
|
211
|
+ }
|
|
|
|
212
|
+
|
|
|
|
213
|
+ /**
|
|
193
|
* @remark :通知首页更新
|
214
|
* @remark :通知首页更新
|
|
194
|
* @name :IsHome
|
215
|
* @name :IsHome
|
|
195
|
* @author :lyh
|
216
|
* @author :lyh
|