ContactController.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
<?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;
/**
* @title 联系我们
*/
class ContactController extends RestBaseController
{
/**
* @title 联系我们详情
* @description 接口说明
* @author 开发者
* @url /api/home/contact/contactDetail
* @method GET
*
* @param name:language type:string require:0 default: other desc:语言切换(英文传递此字段(en),中文无需传递)
*
* @return id:联系我们id
* @return company_name:公司名称
* @return address:地址
* @return mobile:电话
* @return phone:手机
* @return wx:微信
* @return email:邮箱
*/
public function contactDetail(){
$language = $this->request->param('language');
if(isset($language) && !empty($language)){
//英文
$field_contact = 'id,company_name_en company_name,address_en address,mobile,phone,wx,email';
}else{
//中文
$field_contact = 'id,company_name,address,mobile,phone,wx,email';
}
$res = CommonController::findData('contact',['id'=>1],$field_contact);
$this->success('成功',$res);
}
}