PageSettingController.php
1.6 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
<?php
/**
* @remark :
* @name :PageSettingController.php
* @author :lyh
* @method :post
* @time :2023/10/21 15:25
*/
namespace App\Http\Controllers\Bside\BCom;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Models\Project\PageSetting;
class PageSettingController extends BaseController
{
/**
* @remark :根据项目设置获取页面是否使用公共头部底部
* @name :read
* @author :lyh
* @method :post
* @time :2023/10/21 15:26
*/
public function info(){
$pageSettingModel = new PageSetting();
$info = $pageSettingModel->read(['project_id'=>$this->user['project_id']]);
if($info === false){
$info = [
'project_id'=>$this->user['project_id'],
'product_list'=>0,
'product_details'=>0,
'page_keyword'=>0,
'blog_lists'=>0,
'blog_details'=>0,
'news_list'=>0,
'news_details'=>0,
];
$pageSettingModel->add($info);
}
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :设置是否使用公共头和底
* @name :edit
* @author :lyh
* @method :post
* @time :2023/10/21 15:36
*/
public function edit(){
$pageSettingModel = new PageSetting();
$rs = $pageSettingModel->edit($this->param,['project_id'=>$this->user['project_id']]);
if($rs === false){
$this->response('系统错误,请联系管理员',Code::SYSTEM_ERROR);
}
$this->response('success');
}
}