|
|
|
1
|
+<?php
|
|
|
|
2
|
+/**
|
|
|
|
3
|
+ * @remark :
|
|
|
|
4
|
+ * @name :AggregationSettingController.php
|
|
|
|
5
|
+ * @author :lyh
|
|
|
|
6
|
+ * @method :post
|
|
|
|
7
|
+ * @time :2023/10/23 11:06
|
|
|
|
8
|
+ */
|
|
|
|
9
|
+
|
|
|
|
10
|
+namespace App\Http\Controllers\Bside\Setting;
|
|
|
|
11
|
+
|
|
|
|
12
|
+use App\Enums\Common\Code;
|
|
|
|
13
|
+use App\Http\Controllers\Bside\BaseController;
|
|
|
|
14
|
+use App\Models\WebSetting\AggregationSetting;
|
|
|
|
15
|
+
|
|
|
|
16
|
+/**
|
|
|
|
17
|
+ * @remark :聚合页
|
|
|
|
18
|
+ * @name :AggregationSettingController
|
|
|
|
19
|
+ * @author :lyh
|
|
|
|
20
|
+ * @method :post
|
|
|
|
21
|
+ * @time :2023/10/23 11:06
|
|
|
|
22
|
+ */
|
|
|
|
23
|
+class AggregationSettingController extends BaseController
|
|
|
|
24
|
+{
|
|
|
|
25
|
+ /**
|
|
|
|
26
|
+ * @remark :获取聚合页设置详情
|
|
|
|
27
|
+ * @name :info
|
|
|
|
28
|
+ * @author :lyh
|
|
|
|
29
|
+ * @method :post
|
|
|
|
30
|
+ * @time :2023/10/23 11:08
|
|
|
|
31
|
+ */
|
|
|
|
32
|
+ public function info(){
|
|
|
|
33
|
+ $aggSettingModel = new AggregationSetting();
|
|
|
|
34
|
+ $info = $aggSettingModel->read(['project_id'=>$this->user['project_id']]);
|
|
|
|
35
|
+ if($info === false){
|
|
|
|
36
|
+ $data = [
|
|
|
|
37
|
+ 'title'=>'',
|
|
|
|
38
|
+ 'content'=>'',
|
|
|
|
39
|
+ 'top_banner'=>json_encode([]),
|
|
|
|
40
|
+ 'foot_banner'=>json_encode([]),
|
|
|
|
41
|
+ 'project_id'=>$this->user['project_id']
|
|
|
|
42
|
+ ];
|
|
|
|
43
|
+ $aggSettingModel->add($data);
|
|
|
|
44
|
+ }
|
|
|
|
45
|
+ $info['top_banner'] = json_decode($info['top_banner']);
|
|
|
|
46
|
+ $info['foot_banner'] = json_decode($info['foot_banner']);
|
|
|
|
47
|
+ $this->response('success',Code::SUCCESS,$info);
|
|
|
|
48
|
+ }
|
|
|
|
49
|
+
|
|
|
|
50
|
+ /**
|
|
|
|
51
|
+ * @remark :修改聚合页设置
|
|
|
|
52
|
+ * @name :edit
|
|
|
|
53
|
+ * @author :lyh
|
|
|
|
54
|
+ * @method :post
|
|
|
|
55
|
+ * @time :2023/10/23 11:11
|
|
|
|
56
|
+ */
|
|
|
|
57
|
+ public function edit(){
|
|
|
|
58
|
+ $aggSettingModel = new AggregationSetting();
|
|
|
|
59
|
+ $this->param['top_banner'] = json_encode($this->param['top_banner']);
|
|
|
|
60
|
+ $this->param['foot_banner'] = json_encode($this->param['foot_banner']);
|
|
|
|
61
|
+ $rs = $aggSettingModel->edit($this->param,['project_id'=>$this->user['project_id']]);
|
|
|
|
62
|
+ if($rs === false){
|
|
|
|
63
|
+ $this->response('系统错误请联系管理员',Code::SYSTEM_ERROR);
|
|
|
|
64
|
+ }
|
|
|
|
65
|
+ $this->response('success');
|
|
|
|
66
|
+ }
|
|
|
|
67
|
+} |