UserNeedController.php 2.6 KB
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: wuwu <15093565100@163.com>
// +----------------------------------------------------------------------
namespace api\portal\controller;

use api\portal\model\MemberModel;
use api\portal\model\PortalPostModel;
use cmf\controller\RestBaseController;
use think\Db;
use think\Request;
use think\Loader;
use think\Config;
use think\captcha\Captcha;
use think\Url;
use SmsDemo;
//use think\Route;
/**
 * @title 用户接口
 * @description 接口说明
 * @group 接口分组
 */

class UserNeedController extends CommonController
{
    protected $postModel;
    public function __construct(PortalPostModel $postModel)
    {
        parent::__construct();
        $this->postModel = $postModel;
    }
    /**
     * @title  用户发布需求的保证金
     * @description 接口说明
     * @author 开发者
     * @url /api/portal/UserNeed/payMoney
     * @method POST
     * @param name:city type:int require:1 default: other: desc:地区
     * @param name:quarters type:int require:1 default: other: desc:小区
     * @param name:password type:int require:1 default: other: desc:密码
     */
    public function payMoney(Request $request){
        $data = $request->param();
        if(!$data['city'] || !$data['area'] ){
            $this->apiResponse('0','城市、面积不能为空');
        }
        $city = $data['city'];
        $area = $data['area'];

    }


    /**
     * @title  用户发布需求
     * @description 接口说明
     * @author 开发者
     * @url /api/portal/UserNeed/send
     * @method POST
     * @param name:city type:int require:1 default: other: desc:地区
     * @param name:quarters type:int require:1 default: other: desc:小区
     * @param name:password type:int require:1 default: other: desc:密码
     */
    public function send(Request $request)
    {
        if($request->Post()){
            $data = $request->param();
//            判空,处理
//            加数据库
        }else{
//            问答内容
            $where_pro['status'] = 1;
            $list = Db::name('NeedAnswer')->where($where_pro)->order("update_time desc")->find();
            if($list){
                $this->apiResponse('1','成功',$list);
            }else{
                $this->apiResponse('0','暂无内容');
            }

        }
    }




}