WebSettingFromLogic.php
1.7 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
namespace App\Http\Logic\Bside\Setting;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\WebSetting\WebSettingForm;
class WebSettingFromLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new WebSettingForm();
$this->param = $this->requestAll;
}
/**
* @name :(获取表单设置详情)setting_from_info
* @author :lyh
* @method :post
* @time :2023/5/4 13:43
*/
public function setting_from_info(){
$info = $this->model->read(['project_id'=>$this->user['project_id']]);
if($info === false){
$this->fail('当前数据不存在,或者已被删除');
}
return $this->success($info);
}
/**
* @name :(表单设置)setting_from_save
* @param :(is_required是否必填,name名称)
* @author :lyh
* @method :post
* @time :2023/5/4 10:39
*/
public function setting_from_save(){
if(isset($this->param['id']) && !empty($this->param['id'])){
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
}else{
$this->param['project_id'] = $this->user['project_id'];
$rs = $this->model->add($this->param);
}
if($rs === false){
$this->fail('error');
}
return $this->success();
}
/**
* @name :(删除表单设置)setting_from_del
* @param : (id主键)
* @author :lyh
* @method :post
* @time :2023/5/4 11:01
*/
public function setting_from_del(){
$rs = $this->model->del($this->param);
if($rs === false){
$this->fail('error');
}
return $this->success();
}
}