当前位置: 首页>>代码示例>>PHP>>正文


PHP Model_Broker_AjkBrokerExtend::getUserIdByBrokerId方法代码示例

本文整理汇总了PHP中Model_Broker_AjkBrokerExtend::getUserIdByBrokerId方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Broker_AjkBrokerExtend::getUserIdByBrokerId方法的具体用法?PHP Model_Broker_AjkBrokerExtend::getUserIdByBrokerId怎么用?PHP Model_Broker_AjkBrokerExtend::getUserIdByBrokerId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model_Broker_AjkBrokerExtend的用法示例。


在下文中一共展示了Model_Broker_AjkBrokerExtend::getUserIdByBrokerId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handle_request

 public function handle_request()
 {
     $refundClickList = Model_Stats_JpBlackVppv::scanByClickDt($this->_startId, $this->_date, self::BATCH_LIMIT);
     foreach ($refundClickList as $refundClick) {
         $this->setFlag(array('id' => $refundClick['id']));
         $this->setLogContentPrefix($refundClick['id']);
         $this->setLog(sprintf('点击信息:%s', json_encode($refundClick)));
         $chargeLog = Model_Log_JpCharge::getRowById($refundClick['id']);
         if (empty($chargeLog)) {
             $this->setLog('没有获取到点击的扣费信息');
             continue;
         }
         $this->setLog(sprintf('扣费信息: %s', json_encode($chargeLog)));
         if (Model_Log_JpCharge::CHARGE_TYPE_0 != $chargeLog[Model_Log_JpCharge::CHARGE_TYPE]) {
             $this->setLog('不是扣费记录');
             continue;
         }
         if ($chargeLog['spread_type'] != Model_Log_JpCharge::SPREAD_TYPE_2) {
             $this->setLog('非精选扣费');
             continue;
         }
         if ($chargeLog['is_refund'] != Model_Log_JpCharge::IS_REFUND_0) {
             $this->setLog('已经退费过了');
             continue;
         }
         /** 执行退费逻辑 调用 Java API */
         $jpMemberInfo = Model_Broker_JpBroker::getBrokerInfoById($refundClick['memberId'], array('ajkMemberId', 'id', 'isDelete', 'source'));
         if (empty($jpMemberInfo)) {
             $this->setLog(sprintf('没有获取到用户[%d]的信息', $refundClick['memberId']));
             continue;
         }
         $this->setLog(sprintf('用户[%d]的信息: %s', $refundClick['memberId'], json_encode($jpMemberInfo)));
         $ajkUserId = Model_Broker_AjkBrokerExtend::getUserIdByBrokerId($jpMemberInfo['ajkMemberId']);
         if ($ajkUserId == 0) {
             $this->setLog(sprintf('没有获取到用户[jp:%d ajk:%d]的user id', $refundClick['memberId'], $jpMemberInfo['ajkMemberId']));
             continue;
         }
         $this->setLog(sprintf('用户[jp:%d ajk:%d]的userId=%d', $refundClick['memberId'], $jpMemberInfo['ajkMemberId'], $ajkUserId));
         $params = array('reqId' => $refundClick['id'], 'userId' => $ajkUserId, 'amount' => $chargeLog['real_cost'], 'note' => sprintf('房源[%d]精选点击退费', $refundClick['proId']));
         $this->setLog(sprintf('请求的参数:%s', http_build_query($params)));
         $refundSuccess = false;
         for ($i = 0; $i < 3; $i++) {
             /**
              * @var Bll_Service_Client_HttpResponse $apiResponse
              */
             $apiResponse = Bll_Service_Payment::refund(Const_PaymentApp::JP_SITE, $params);
             $this->setLog(sprintf('调用API退费返回值:%s', json_encode($apiResponse->getResponse())));
             if ($apiResponse->isSucceeded() && isset($apiResponse['result']) && $apiResponse['result'] == true) {
                 $refundSuccess = true;
                 break;
             }
         }
         if ($refundSuccess == false) {
             $this->setLog('调用API退费失败');
             continue;
         }
         /** 更新扣费日志状态 */
         if (false == Model_Log_JpCharge::refund($chargeLog['id'])) {
             $this->setLog(sprintf('[%d] 修改表 Model_Log_JpCharge.is_refund 失败', $chargeLog['id']));
         } else {
             $this->setLog(sprintf('[%d] 修改表 Model_Log_JpCharge.is_refund 成功', $chargeLog['id']));
         }
     }
     if (count($refundClickList) < self::BATCH_LIMIT) {
         $this->removeFlag();
         $this->setShStopFlag();
         $this->setLog('处理完成...');
     }
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:69,代码来源:ClickRefund.php


注:本文中的Model_Broker_AjkBrokerExtend::getUserIdByBrokerId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。