作者 潘浩文
1 个管道 的构建 通过 耗费 1 秒

XIAOPAN

... ... @@ -528,6 +528,17 @@ class UsersController extends HomeBaseController{
$user_id=input('user_id');
$fee=$this->request->param('fee');
$user=Db::name('users')->where('id',$user_id)->find();
$order= Db::name('order')
->alias('o')
->join('equipment e','o.eq_name=e.name')
->field('o.order_no,o.users_id,o.start_time,e.serial_number,e.hospital')
->where(['o.users_id'=>$user_id,'o.state'=>1,'o.type'=>1,'e.is_delete'=>0])
->find();
if ($order){
$this->apiResponse(302,'有未完成订单');
}
if ($user['fee']>=$fee) {
//生成订单号
$order_sn=cmf_get_order_sn();
... ...