|
|
<?php
|
|
|
/**
|
|
|
* Created by PhpStorm.
|
|
|
* User: Administrator
|
|
|
* Date: 2020/7/10
|
|
|
* Time: 17:32
|
|
|
*/
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
|
|
|
use app\common\controller\Api;
|
|
|
use think\Cache;
|
|
|
use think\Db;
|
|
|
|
|
|
/**
|
|
|
* 社区首页
|
|
|
*/
|
|
|
class House extends Api
|
|
|
{
|
|
|
protected $noNeedLogin = ['*'];
|
|
|
protected $noNeedRight = ['*'];
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (首页轮播图)
|
|
|
* @ApiSummary (首页轮播图)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/house/banner)
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
"id"://id
|
|
|
"image"://图片
|
|
|
"url"://跳转地址
|
|
|
"typeswitch"://开关0关1开
|
|
|
"createtime"://创建时间
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function banner()
|
|
|
{
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$data = Db::name('banner')->field('updatetime',true)->order('createtime desc')->select();
|
|
|
foreach ($data as &$v){
|
|
|
$v['image'] = $qiniu.$v['image'];
|
|
|
$v['createtime'] = date('Y-m-d H:i:s',$v['createtime']);
|
|
|
}
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (首页社区名称以及社区公告)
|
|
|
* @ApiSummary (首页社区名称以及社区公告)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/house/house)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
"is_binding"://是否绑定1已绑定2未绑定
|
|
|
"house_name"://社区名称
|
|
|
"is_have"://是否有社区公告1有2没有
|
|
|
"title"://社区公告标题
|
|
|
"is_new"://是否是新 1是2否
|
|
|
"content"://公告内容
|
|
|
"look_num"://浏览人数
|
|
|
"createtime"://时间
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function house()
|
|
|
{
|
|
|
$user_id = $this->auth->id;
|
|
|
$data = Db::name('user')
|
|
|
->where('id',$user_id)
|
|
|
->field('id,house_id')
|
|
|
->find();
|
|
|
if(empty($data['house_id'])){
|
|
|
$info['is_binding'] = 2;
|
|
|
}else{
|
|
|
$info['is_binding'] = 1;
|
|
|
$info['house_name'] = Db::name('house')->where('id',$data['house_id'])->value('name');
|
|
|
|
|
|
//查询该社区的社区公告
|
|
|
$house_board = Db::name('house_board')->where('house_id',$data['house_id'])->order('createtime desc')->find();
|
|
|
if(empty($house_board)){
|
|
|
$info['is_have'] = 2;
|
|
|
$info['title'] = '';
|
|
|
$info['content'] = '';
|
|
|
$info['createtime'] = '';
|
|
|
$info['look_num'] = '';
|
|
|
$info['is_new'] = 2;
|
|
|
}else{
|
|
|
$info['is_have'] = 1;
|
|
|
$info['title'] = $house_board['title'];
|
|
|
$info['content'] = $house_board['content'];
|
|
|
$info['look_num'] = $house_board['look_num'];
|
|
|
$info['createtime'] = date('Y-m-d',$house_board['createtime']);
|
|
|
|
|
|
//查询是否已读
|
|
|
$is_read = Db::name('house_board_detail')->where('user_id',$user_id)->where('house_board_id',$house_board['id'])->find();
|
|
|
if(empty($is_read)){
|
|
|
$info['is_new'] = 2;
|
|
|
}else{
|
|
|
$info['is_new'] = 1;
|
|
|
}
|
|
|
}
|
|
|
$this->success('success',$info);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (首页展开公告)
|
|
|
* @ApiSummary (首页展开公告)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/house/house_board_detail)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="house_board_id", type="inter", required=true, description="公告id")
|
|
|
*
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
"title"://社区公告标题
|
|
|
"content"://公告内容
|
|
|
"look_num"://浏览人数
|
|
|
"createtime"://时间
|
|
|
"avatar"://用户头像
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function house_board_detail()
|
|
|
{
|
|
|
$user_id = $this->auth->id;
|
|
|
$id = $this->request->param('house_board_id');
|
|
|
if(empty($id)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
|
|
|
$info['user_id'] = $user_id;
|
|
|
$info['house_board_id'] = $id;
|
|
|
$info['createtime'] = time();
|
|
|
$res = Db::name('house_board_detail')->where('user_id',$info['user_id'])->where('house_board_id',$info['house_board_id'])->find();
|
|
|
if(empty($res)){
|
|
|
Db::name('house_board_detail')->insertGetId($info);
|
|
|
Db::name('house_board')->where('id',$id)->setInc('look_num');
|
|
|
}
|
|
|
|
|
|
$data = Db::name('house_board')
|
|
|
->field('id,house_id,title,content,look_num,createtime')
|
|
|
->where('deletime','')
|
|
|
->where('id',$id)
|
|
|
->find();
|
|
|
$data['createtime'] = date('Y-m-d',$data['createtime']);
|
|
|
|
|
|
|
|
|
$data['avatar'] = Db::name('house_board')
|
|
|
->alias('a')
|
|
|
->join('user b','a.user_id = b.id')
|
|
|
->where('a.house_board_id',$id)
|
|
|
->field('a.user_id,b.nickname,b.avatar')
|
|
|
->limit(6)
|
|
|
->select();
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (公告全部已读用户头像信息)
|
|
|
* @ApiSummary (公告全部已读用户头像信息)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/house/avatar)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="house_board_id", type="inter", required=true, description="公告id")
|
|
|
*
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
"id"://用户id
|
|
|
"avatar"://用户头像
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function avatar()
|
|
|
{
|
|
|
$user_id = $this->auth->id;
|
|
|
$id = $this->request->param('house_board_id');
|
|
|
if(empty($id)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
$data = Db::name('house_board_detail')
|
|
|
->alias('a')
|
|
|
->join('user b','a.user_id = b.id')
|
|
|
->field('b.id,b.avatar')
|
|
|
->order('a.createtime desc')
|
|
|
->select();
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (社区列表)
|
|
|
* @ApiSummary (社区列表)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/house/house_list)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="area", type="string", required=true, description="市区地址例如:'天津市/西青区'")
|
|
|
* @ApiParams (name="keyword", type="string", required=false, description="关键字")
|
|
|
*
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
"id"://小区id
|
|
|
"name"://小区名称
|
|
|
"area"://所在区
|
|
|
"shen_status"://状态0选择1申请中2已绑定
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function house_list()
|
|
|
{
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$user_id = $this->auth->id;
|
|
|
$area = $this->request->param('area');
|
|
|
if(empty($area)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
$keyword = $this->request->param('keyword');
|
|
|
if(!empty($keyword)){
|
|
|
$where['name'] = ['like',"%$keyword%"];
|
|
|
}else{
|
|
|
$where = true;
|
|
|
}
|
|
|
|
|
|
//查询该市区下的所有小区
|
|
|
$data = Db::name('house')
|
|
|
->where('area','like',"%$area%")
|
|
|
->where($where)
|
|
|
->field('id,name,area')
|
|
|
->order('createtime desc')
|
|
|
->select();
|
|
|
|
|
|
//查出该用户已绑定的和申请中的小区
|
|
|
$user_house = Db::name('user_house')
|
|
|
->where('user_id',$user_id)
|
|
|
->select();
|
|
|
|
|
|
foreach ($data as &$v){
|
|
|
foreach ($user_house as &$val){
|
|
|
if($v['id'] == $val['house_id']){
|
|
|
$v['shen_status'] = $val['status'];
|
|
|
}else{
|
|
|
$v['shen_status'] = 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (社区公告轮播图)
|
|
|
* @ApiSummary (社区公告轮播图)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/house/house_banner)
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
"id"://id
|
|
|
"image"://图片
|
|
|
"url"://跳转地址
|
|
|
"typeswitch"://开关0关1开
|
|
|
"createtime"://创建时间
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function house_banner()
|
|
|
{
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$data = Db::name('advertising')->field('updatetime',true)->order('createtime desc')->select();
|
|
|
foreach ($data as &$v){
|
|
|
$v['image'] = $qiniu.$v['image'];
|
|
|
$v['createtime'] = date('Y-m-d H:i:s',$v['createtime']);
|
|
|
}
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (公告列表)
|
|
|
* @ApiSummary (公告列表)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/house/house_board_list)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="house_board_id", type=inter, required=true, description="社区id")
|
|
|
* @ApiParams (name="page", type="inter", required=false, description="当前页(默认1)")
|
|
|
* @ApiParams (name="pageNum", type="inter", required=false, description="每页显示数据个数(默认10)")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
"total_num"://总条数
|
|
|
"info":[
|
|
|
"id"://公告id
|
|
|
"title"://社区公告标题
|
|
|
"content"://公告内容
|
|
|
"look_num"://浏览人数
|
|
|
"createtime"://时间
|
|
|
"avatar"://用户头像
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function house_board_list()
|
|
|
{
|
|
|
$page = $this->request->param('page', 1, 'intval');
|
|
|
$pageNum = $this->request->param('pageNum', 10, 'intval');
|
|
|
$user_id = $this->auth->id;
|
|
|
$house_id = $this->request->param('house_board_id');
|
|
|
if(empty($house_id)){
|
|
|
$this->error('社区id不能为空');
|
|
|
}
|
|
|
$data['total_num'] = Db::name('house_board')
|
|
|
->where('house_id',$house_id)
|
|
|
->count();
|
|
|
$data['info'] = Db::name('house_board')
|
|
|
->where('house_id',$house_id)
|
|
|
->order('weigh desc')
|
|
|
->page($page,$pageNum)
|
|
|
->select();
|
|
|
foreach ($data['info'] as &$v){
|
|
|
$v['createtime'] = date('Y-m-d',$v['createtime']);
|
|
|
//查询用户是否在已读公告详情中
|
|
|
$house_board_detail = Db::name('house_board_detail')
|
|
|
->where('user_id',$user_id)
|
|
|
->where('house_board_id',$v['id'])
|
|
|
->find();
|
|
|
if(empty($house_board_detail)){
|
|
|
$info['user_id'] = $user_id;
|
|
|
$info['house_board_id'] = $v['id'];
|
|
|
$info['createtime'] = time();
|
|
|
Db::name('house_board_detail')->insertGetId($info);
|
|
|
Db::name('house_board')->where('id',$v['id'])->setInc('look_num');
|
|
|
}
|
|
|
|
|
|
$v['avatar'] = Db::name('house_board_detail')
|
|
|
->alias('a')
|
|
|
->join('user b','a.user_id = b.id')
|
|
|
->where('a.house_board_id',$v['id'])
|
|
|
->field('b.avatar,b.id')
|
|
|
->limit(6)
|
|
|
->select();
|
|
|
}
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (市级列表)
|
|
|
* @ApiSummary (市级列表)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/house/city_list)
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
"id"://市级id
|
|
|
"name"://市级名称
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function city_list()
|
|
|
{
|
|
|
$data = Db::name('area')->field('id,name')->where('level',2)->select();
|
|
|
$this->success('success',$data);
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (区级列表)
|
|
|
* @ApiSummary (区级列表)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/house/country_list)
|
|
|
*
|
|
|
* @ApiParams (name="id", type="string", required=true, description="市级id")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
"id"://区级id
|
|
|
"name"://区级名称
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function country_list()
|
|
|
{
|
|
|
$id = $this->request->param('id');
|
|
|
if(empty($id)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
|
|
|
$data = Db::name('area')
|
|
|
->where('level',3)
|
|
|
->where('pid',$id)
|
|
|
->field('id,name')
|
|
|
->select();
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (申请加入社区)
|
|
|
* @ApiSummary (申请加入社区)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/house/joinhouse)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="house_id", type="string", required=true, description="小区id")
|
|
|
* @ApiParams (name="name", type="string", required=true, description="姓名")
|
|
|
* @ApiParams (name="phone", type="string", required=true, description="手机号")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function joinhouse()
|
|
|
{
|
|
|
$param['user_id'] = $this->auth->id;
|
|
|
$param = $this->request->param();
|
|
|
$validate = new Validate([
|
|
|
'house_id' => 'require',
|
|
|
'name' => 'require',
|
|
|
'phone' => 'require'
|
|
|
]);
|
|
|
if (!$validate->check($param)) {
|
|
|
$this->error($validate->getError());
|
|
|
}
|
|
|
$data = Db::name('user_house')->insertGetId($param);
|
|
|
if(empty($data)){
|
|
|
$this->error('申请失败');
|
|
|
}else{
|
|
|
Db::name('user')->where('id',$param['user_id'])->update(['mobile'=>$param['phone']]);
|
|
|
$this->success('成功');
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (邀请加入社区)
|
|
|
* @ApiSummary (邀请加入社区)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/house/invite_join)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="house_id", type="string", required=true, description="小区id")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
"thumbnail"://二维码图片
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function invite_join(){
|
|
|
$user_id = $this->auth->id;
|
|
|
$house_id = $this->request->param('house_id');
|
|
|
if(empty($house_id)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
$data = Db::name('house')->where('id',$house_id)->field('thumbnail')->find();
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (社区电话)
|
|
|
* @ApiSummary (社区电话)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/house/house_phone)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="house_id", type="string", required=true, description="小区id")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
"id"://id
|
|
|
"name"://电话名称
|
|
|
"phone"://电话
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function house_phone()
|
|
|
{
|
|
|
$user_id = $this->auth->id;
|
|
|
$house_id = $this->request->param('house_id');
|
|
|
if(empty($house_id)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
$data = Db::name('house_phone')->field('id,name,phone')->where('house_id',$house_id)->select();
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (获取验证码)
|
|
|
* @ApiSummary (获取验证码)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/login/getcode)
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
*
|
|
|
* @ApiParams (name="mobile", type="string", required=false, description="手机号")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "SUCCESS",
|
|
|
"time": "1553839125",
|
|
|
"data": {
|
|
|
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function getcode()
|
|
|
{
|
|
|
$phone = $this->request->param('mobile');
|
|
|
if (empty($phone)) {
|
|
|
$this->error(['code' => 40005, 'msg' => '手机号不能为空']);
|
|
|
}
|
|
|
if (!preg_match('/^1[0-9]{10}$/', $phone)) {
|
|
|
$this->error(['code' => 40005, 'msg' => "请输入正确的手机格式!"]);
|
|
|
}
|
|
|
//生成验证码
|
|
|
$number = generateCode();
|
|
|
//发送验证码
|
|
|
$data = array(
|
|
|
'content' => "【社区】提醒您,您的验证码是:" .$number.",十分钟之内有效,请勿向他人泄漏您的验证码",//短信内容
|
|
|
'mobile' => $phone,//手机号码
|
|
|
'productid' => '676767',//产品id
|
|
|
'xh' => ''//小号
|
|
|
);
|
|
|
$result = send_sms($data);
|
|
|
if (substr($result, 0, strpos($result, ',')) != "1") {
|
|
|
$this->error(['code' => 42001, 'msg' => $result]);
|
|
|
}
|
|
|
Cache::set($phone,$number,600);
|
|
|
$this->success('SUCCESS');
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (验证验证码)
|
|
|
* @ApiSummary (验证验证码)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/login/verify)
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
*
|
|
|
* @ApiParams (name="mobile", type="string", required=true, description="手机号")
|
|
|
* @ApiParams (name="code", type="string", required=true, description="验证码")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "SUCCESS",
|
|
|
"time": "1553839125",
|
|
|
"data": {
|
|
|
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function verify()
|
|
|
{
|
|
|
$param = $this->request->param();
|
|
|
$validate = new Validate([
|
|
|
'mobile' => 'require|max:11',
|
|
|
'code'=>'require'
|
|
|
]);
|
|
|
if (!$validate->check($param)) {
|
|
|
$this->error(['code'=>40005,'msg'=>$validate->getError()]);
|
|
|
}
|
|
|
$code = Cache::get($param['mobile']);
|
|
|
if($param['code'] == $code){
|
|
|
$this->success('SUCCESS');
|
|
|
}else{
|
|
|
$this->error('验证码错误或者失效,请重新发送');
|
|
|
}
|
|
|
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|