UsersController.php
1.1 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
<?php
/**
* Created by PhpStorm.
* User: ruidiudiu
* Date: 2018/11/23
* Time: 18:26
*/
namespace app\portal\controller;
use cmf\controller\HomeBaseController;
use think\Db;
class UsersController extends HomeBaseController{
/**
* @title 状态验证
* @description 开锁前判断是否有未支付订单与是否提交押金
* @author 董瑞恩
* @url /portal/Aes/lock_check
* @method GET
*
* @param name:users_id type:String require:1 default:无 other: desc:用户id
*/
public function lock_check(){
$users_id=$this->request->param('users_id');
//获取提交押金的状态
$users=Db::name('users')->where('id',$users_id)->find();
if ($users['is_deposit']===1){
$order=Db::name('order')->where(['users_id'=>$users_id,'state'=>1])->find();
if (empty($order)){
$this->apiResponse(200,'验证通过');
}else{
$this->apiResponse(302,'有未支付订单');
}
}else{
$this->apiResponse(301,'未支付押金');
}
}
}