Пример #1
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $customerId = $this->_params['customerId'];
     // 判断经纪人是否存在
     $broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
     if (!$broker) {
         throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId);
     }
     $customer = Model_Mobile_BrokerUserRelationSub::getStatusByCustomerIdBrokerId($brokerId, $customerId);
     if (empty($customer)) {
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'message' => 'customerId不存在');
     }
     $rs = Model_Mobile_BrokerUserRelationSub::updateStatus($customer['brokerId'], $customer['userDeviceId']);
     if ($rs) {
         $date = date('Ymd');
         Model_Mobile_CustomerUserRushedCount::updateCustomerNum($customer['userDeviceId'], $date);
         return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('message' => '释放成功'));
     } elseif ($rs == 0) {
         return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('message' => '已经释放'));
     } else {
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'message' => '释放失败');
     }
 }