作者 lyh

gx

... ... @@ -15,7 +15,7 @@ class WebSettingServiceController extends BaseController
* @time :2023/5/4 11:28
*/
public function lists(WebSettingServiceLogic $webSettingServiceLogic){
$lists = $webSettingServiceLogic->setting_service_info();
$lists = $webSettingServiceLogic->setting_service_list();
$this->response('success',Code::SUCCESS,$lists);
}
/**
... ... @@ -29,14 +29,4 @@ class WebSettingServiceController extends BaseController
$this->response('success');
}
/**
* @name :del
* @author :lyh
* @method :post
* @time :2023/5/4 11:28
*/
public function del(WebSettingServiceLogic $webSettingServiceLogic){
$webSettingServiceLogic->setting_service_del();
$this->response('success');
}
}
... ...
... ... @@ -28,6 +28,7 @@ class WebSettingFromLogic extends BaseLogic
}
return $this->success($info);
}
/**
* @name :(表单设置)setting_from_save
* @param :(is_required是否必填,name名称)
... ... @@ -36,30 +37,16 @@ class WebSettingFromLogic extends BaseLogic
* @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){
try {
//删除以前的数据
$param['project_id'] = ['in',$this->user['project_id']];
$this->model->del($param);
//新增
$this->model->add($this->param);
}catch (\Exception $e){
$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();
}
}
... ...
... ... @@ -2,7 +2,6 @@
namespace App\Http\Logic\Bside\Setting;
use App\Http\Controllers\ImageLogic;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Image;
use App\Models\WebSetting\WebSettingService;
... ... @@ -24,9 +23,9 @@ class WebSettingServiceLogic extends BaseLogic
* @method :post
* @time :2023/5/4 11:23
*/
public function setting_service_info(){
$info = $this->model->read(['project_id'=>$this->param['project_id']]);
return $this->success($info);
public function setting_service_list(){
$list = $this->model->list(['project_id'=>$this->param['project_id']]);
return $this->success($list);
}
/**
... ... @@ -36,12 +35,13 @@ class WebSettingServiceLogic extends BaseLogic
* @time :2023/5/4 11:10
*/
public function setting_service_save(){
if(isset($this->param['id'])){
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
}else{
$rs = $this->model->add($this->param);
}
if($rs === false){
try {
//删除以前的数据
$param['project_id'] = ['in',$this->user['project_id']];
$this->model->del($param);
//新增
$this->model->add($this->param);
}catch (\Exception $e){
$this->fail('error');
}
return $this->success();
... ...