WebSettingFromLogic.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
47
48
49
50
51
<?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->list(['project_id'=>$this->user['project_id']],'created_at');
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(){
try {
//删除以前的数据
$this->model->del(['project_id'=>$this->user['project_id']]);
//新增
$this->model->add($this->param['data']);
}catch (\Exception $e){
$this->fail('error');
}
return $this->success();
}
}