WebSettingHtmlLogic.php
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace App\Http\Logic\Bside\Setting;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\WebSetting\WebSettingHtml;
class WebSettingHtmlLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new WebSettingHtml();
$this->param = $this->requestAll;
}
/**
* @name :(设置第三方代码)setting_html_info
* @param : (head_html头,body_html中,footer_html尾)
* @author :lyh
* @method :post
* @time :2023/5/4 10:18
*/
public function setting_html_save(){
if(isset($this->param) && !empty($this->param)){
$info = $this->model->read(['project_id'=>$this->user['project_id']]);
if($info === false){
$this->param['project_id'] = $this->user['project_id'];
$rs = $this->model->add($this->param);
}else{
$rs = $this->model->edit($this->param,['project_id'=>$this->user['project_id']]);
}
if($rs === false){
$this->fail('error');
}
$info = $this->param;
}else{
$info = $this->model->read(['project_id'=>$this->user['project_id']]);
if($info === false){
$info = [];
}
}
return $this->success($info);
}
}