public function orderRelationUpdateNotify($orderRelationUpdateNotifyRequest) { $orderRelationUpdateNotifyResponse = array('resultCode' => -6, 'recordSequenceId' => C('DB_HOST')); $user = new UserService(); $lastsql = $user->addVacLog($orderRelationUpdateNotifyRequest); $recordSequenceId = $orderRelationUpdateNotifyRequest->recordSequenceId; $userIdType = $orderRelationUpdateNotifyRequest->userIdType; $userId = $orderRelationUpdateNotifyRequest->userId; $serviceType = $orderRelationUpdateNotifyRequest->serviceType; $spId = $orderRelationUpdateNotifyRequest->spId; $productId = $orderRelationUpdateNotifyRequest->productId; $updateType = $orderRelationUpdateNotifyRequest->updateType; $updateTime = $orderRelationUpdateNotifyRequest->updateTime; $updateDesc = $orderRelationUpdateNotifyRequest->updateDesc; $linkId = $orderRelationUpdateNotifyRequest->linkId; $content = $orderRelationUpdateNotifyRequest->content; $effectiveDate = $orderRelationUpdateNotifyRequest->effectiveDate; $expireDate = $orderRelationUpdateNotifyRequest->expireDate; $time_stamp = $orderRelationUpdateNotifyRequest->time_stamp; $encodeStr = $orderRelationUpdateNotifyRequest->encodeStr; $Response_order = false; if ($productId == $user->NINE_EDITION && empty($content)) { if ($updateType == 1) { $content = 'ktkj'; $Response_order = true; } else { $content = 'td'; $user->setUserStatus($userId, 2); } } if (strpos(strtoupper($content), 'TD') !== false) { //退订处理 $user_mobile = $user->queryUserMobileByPhoneNumber($userId); if ($user_mobile == null || count($user_mobile) == 0) { $ret['status'] = -99; $ret['msg'] = 'The user mobile [' . $userId . '] not exist!'; } else { $uid = $user_mobile['userid']; $user->setSpace($uid, $productId, $content); $user->setUserCost($userId, $productId, $content); $ret_order = $user->queryUserOrder($uid); if ($ret_order == null || count($ret_order) == 0) { $user->setUserStatus($userId, $user->DISABLED); } $ret['status'] = 0; $ret['msg'] = 'The user mobile [' . $userId . '] order changed!'; } } else { // 订购处理 $password = substr($userId, -6); $ret = $user->RegistUser($userId, $password, $productId, $content); if ($ret['status'] == 0) { $user->setUserStatus($userId, $user->ACTIVATE); $user->setUserCost($userId, $productId, $content); if ($Response_order == 1) { self::sendsms($userId); } $mmsurl = C('MMS_URL') . '?messageid=' . C('MMS_MSGID') . '&phone=' . $userId . '&product=' . $productId; $proxy = C('HTTP_PROXY'); $send_mms = $this->get_proxy($mmsurl, $proxy); $mms = new MmsService(); $mms->writeSendLog($mmsurl, $userId, $productId, $send_mms); $ret['msg'] .= $send_mms; } } $orderRelationUpdateNotifyResponse['resultCode'] = $ret['status']; $orderRelationUpdateNotifyResponse['recordSequenceId'] = $ret['msg']; return $orderRelationUpdateNotifyResponse; }