AboutController.php
1.8 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
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace api\home\controller;
use cmf\controller\RestBaseController;
use app\portal\model\PortalPostModel;
/**
* @title 公司介绍
*/
class AboutController extends RestBaseController
{
/**
* @title 公司介绍
* @description 接口说明
* @author 开发者
* @url /api/home/about/aboutDetail
* @method GET
*
* @param name:language type:string require:0 default: other desc:语言切换(英文传递此字段(en),中文无需传递)
*
* @return id:关于我们id
* @return thumbnail:图片路径
* @return detail:详情(富文本)
* @return video:视频路径
*/
public function aboutDetail(){
$language = $this->request->param('language');
//关于我们
if(isset($language) && !empty($language)){
//英文
$field_about = 'id,thumbnail,detail_en detail,video';
}else{
//中文
$field_about = 'id,thumbnail,detail,video';
}
$detail_about = CommonController::findData('about',['id'=>1],$field_about);
$contentModel = new PortalPostModel();
$detail_about['detail'] = $contentModel->getPostContentAttr($detail_about['detail']);
$this->success('成功',$detail_about);
}
}