ShareController.php 1.6 KB
<?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);
    }

}