ShareController.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
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace api\portal\controller;
use think\Controller;
//use api\portal\model\MemberModel;
//use api\portal\model\UserModel;
//use api\portal\service\PostService;
use think\Db;
use think\Request;
use think\Loader;
/**
* @title 首页接口
* @description 接口说明
* @group 接口分组
*/
class ShareController extends CommonController
{
/**
* @title 分享页面内容
* @description 接口说明
* @author 开发者
* @url /api/portal/Share/index
* @method POST
* @param name:token type:varchar require:1 default: other: desc:token
*/
public function index(Request $request)
{
$data = $request->param();
$where_share['status'] = 1;
$share = Db::name('Share')->where($where_share)->field('id,content,type')->select()->toArray();
$final['share'] = $share;
$where_member['token'] = $data['token'];
$member = Db::name('Member')->where($where_member)->field('id,link')->find();
$final['user'] = $member;
$this->apiResponse('1','成功',$final);
}
}