public function checkFailure($id, $reason = '') { // 获取记录 $contract = $this->find($id); if (!$contract) { $this->error = '认证尚未提交!'; return false; } // 判断状态 if ($contract['status'] != 0) { $this->error = '当前状态不为待审核!'; return false; } $this->where('uid=' . $contract['uid'] . ' and status=0')->save(['status' => 2, 'failure_reason' => $reason]); // 发送推送消息 $this->_push($contract['mobile'], '您的认证审核不通过!', '原因:' . $reason); // 通知订单业务 $orderModel = new \Loan\Model\OrderModel(); $orderModel->checkUserFailure($contract['uid'], $reason); return true; }