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


PHP Model_Broker_AjkBrokerExtend::data_access方法代码示例

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


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

示例1: handle_request_internal

 public function handle_request_internal()
 {
     $userId = $this->_params['userId'];
     $code = $this->_params['code'];
     //4.3之前版本的兼容性处理,此api之后将废弃
     return array('status' => 'error', 'errcode' => Const_APIStatus::E_FYK_USER_ACTIVATION_CODE_CLOSE, 'message' => '此功能已关闭');
     // TODO 校验用户是否存在
     $brokerInfo = Model_Broker_AjkBrokerExtend::data_access()->filter('userId', $userId)->find_only();
     if (!$brokerInfo) {
         throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     // TODO 校验激活码是否有效
     $codeInfo = Model_Fyk_InvitationCodes::data_access()->filter(Model_Fyk_InvitationCodes::CODE, $code)->filter(Model_Fyk_InvitationCodes::BIND_TO, $userId)->get_all();
     if (empty($codeInfo)) {
         return API_Result::create()->error()->errorCode('9999')->message('邀请码错误')->toArray();
     }
     $userInfo = Model_Fyk_Users::data_access()->filter(Model_Fyk_Users::USER_ID, $userId)->find_only();
     if ($userInfo->status != Model_Fyk_Users::INIT) {
         return API_Result::create()->error()->errorCode('9999')->message('房源库功能已经激活')->toArray();
     }
     $userInfo->status = Model_Fyk_Users::INVITATION;
     if ($userInfo->save()) {
         //TODO 关注房源库公共账号-待补充
         $msg = '{"title": "房源库小喵 小贝欢迎大家到来","date": "' . date('m') . '月' . date('d') . '日","img":"http://pic1.ajkimg.com/m/fc68794e8da91a3d03f80487b888a193/540x270x95.jpg","desc": "成交从好的房源开始,好的房源来自移动房源库!","url": "http://api.anjuke.com/web/chat/content?id=101_290_0","jsonVersion": "1"}';
         $chatInfo = Bll_Mobile_ChatInfoBll::getInstance()->getChatInfo($brokerInfo->brokerId, 1);
         $chatId = $chatInfo['data']['chatId'];
         Bll_Mobile_ChatInfoBll::sendFykPublicMsg($chatId, $msg);
         return array('status' => 'ok', 'message' => '激活成功');
     }
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:30,代码来源:Activate.php

示例2: handle_request

 /**
  * Job执行逻辑
  */
 public function handle_request()
 {
     //记录调用api参数
     printf('[%s] lastLogId: %s' . PHP_EOL, date('Y-m-d H:i:s'), $this->lastLogId);
     $logs = $this->getLogList();
     if (!empty($logs)) {
         foreach ($logs as $log) {
             //记录游标
             $this->setFlag(array('id' => $log['id']));
             if ($log['changeType'] == 1) {
                 continue;
             }
             $couponInfo = $this->getCouponInfo($log['brokerCouponId']);
             if (!empty($couponInfo)) {
                 $data = array();
                 $data['changeType'] = 0;
                 if ($log['changeType'] == 2) {
                     $data['changeType'] = 1;
                 } elseif ($log['changeType'] == 3) {
                     $data['changeType'] = 2;
                 }
                 $data['brokerId'] = $log['brokerId'];
                 $data['num'] = $log['num'];
                 $data['changeTime'] = $log['createTime'];
                 $data['price'] = $couponInfo['disPrice'] / $couponInfo['totalNum'] * $data['num'];
                 //消耗的券价值多少
                 $data['realPrice'] = $data['price'];
                 $cityInfo = Model_Broker_AjkBrokerExtend::data_access()->load_field('cityId')->filter('brokerId', $data['brokerId'])->get_row();
                 $data['cityId'] = $cityInfo['cityId'];
                 Model_KuaiJi_CustomerBrokerCouponConsume::create($data)->save();
             }
         }
     }
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:37,代码来源:CouponCosb.php

示例3: communitySignTopSigner

 public static function communitySignTopSigner($communityId, $currentSignRange, $per = 3)
 {
     $signs = Model_Broker_CommunitySign::data_access(date('Ym', strtotime($currentSignRange[0])))->filter('communityId', $communityId)->filter_by_op_multi(array(array('signTime', '>=', $currentSignRange[0]), array('signTime', '<=', $currentSignRange[1])))->sort('signTime', 'asc')->limit(3)->find_all();
     $signers = array();
     if ($signs) {
         $brokerIds = array();
         foreach ($signs as $sign) {
             $brokerIds[] = $sign['brokerId'];
         }
         $brokers = Model_Broker_AjkBrokerExtend::data_access()->filter('brokerId', $brokerIds)->find_all();
         $indexedBrokers = array();
         foreach ($brokers as $broker) {
             $indexedBrokers[$broker['brokerId']] = $broker;
         }
         foreach ($signs as $sign) {
             if (!isset($indexedBrokers[$sign['brokerId']])) {
                 continue;
             }
             $broker = $indexedBrokers[$sign['brokerId']];
             $signer = array();
             $signer['brokerId'] = $broker['brokerId'];
             $signer['brokerTrueName'] = $broker['trueName'];
             // 图片地址替换
             if ($broker['userPhoto']) {
                 $signer['brokerPhoto'] = Util_DisplayImages::get_img_url($broker['userPhoto'], -1, '100x133');
             } else {
                 $signer['brokerPhoto'] = PageHelper::pure_static_url('/img/bknoimg.gif');
                 // 默认头像
             }
             $signers[] = $signer;
         }
     }
     return $signers;
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:34,代码来源:CommunitySign.php

示例4: handle_request_internal

 public function handle_request_internal()
 {
     $mobile = $this->_params['mobile'];
     $brokerInfo = Model_Broker_AjkBrokerExtend::data_access()->filter('userMobile', $mobile)->find_only();
     if (!$brokerInfo) {
         return API_Result::create()->error()->errorCode('9999')->message('经纪人不存在')->toArray();
     }
     $userId = $brokerInfo->userId;
     $userAccountId = Bll_Fyk_Payment_User::getInstance()->getUserAccountId($userId);
     if (empty($userAccountId)) {
         return API_Result::create()->error()->message('没有用户支付中心ID')->toArray();
     }
     $time = date('Y-m-d H:i:s');
     $data['userId'] = $brokerInfo->userId;
     $data['brokerId'] = $brokerInfo->brokerId;
     $data['cityId'] = $brokerInfo->cityId;
     $data['createTime'] = $time;
     $insertUserId = Model_Fyk_Users::getInstance()->insertData($data);
     unset($data);
     if ($insertUserId) {
         do {
             $code = rand(100000, 999999);
             $arr = Model_Fyk_InvitationCodes::data_access()->load_field('id')->filter('code', $code)->get_row();
         } while ($arr !== NULL);
         $data['code'] = $code;
         //生成邀请码
         $data['bindTo'] = $userId;
         $data['createTime'] = $time;
         $insertInvitationCodeId = Model_Fyk_InvitationCodes::getInstance()->insertData($data);
         if ($insertInvitationCodeId) {
             return API_Result::create()->ok()->data(array('status' => 1))->toArray();
         }
     }
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:34,代码来源:Create.php

示例5: get_broker_info

 public function get_broker_info($brokerId)
 {
     $da = Model_Broker_AjkBrokerExtend::data_access();
     $da->filter('brokerId', $brokerId);
     $data = $da->find();
     return $data;
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:7,代码来源:Choice.php

示例6: handle_request_internal

 public function handle_request_internal()
 {
     /**
      * 签到小区列表
      *
      * - 验证参数
      *
      * - 获取经纪人
      *
      * - 根据lat和lng获取1.5km内的小区列表(查询Solr)
      *
      * - 判断经纪人是否签到过(用于设置当前时间段内经纪人是否签到过)
      *
      * - 返回数据
      */
     $result = array('status' => 'error', 'errcode' => '', 'message' => '');
     // 获取参数
     $brokerId = $this->_params['brokerId'];
     $lat = $this->_params['lat'];
     $lng = $this->_params['lng'];
     // 获取经纪人
     $broker = Model_Broker_AjkBrokerExtend::data_access()->filter('brokerId', $brokerId)->find_only();
     if (!$broker) {
         throw new Exception('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     if (empty($lat) || empty($lng)) {
         $result['message'] = '获取定位数据失败,请重新定位';
         return $result;
     }
     // 获取数据
     $communities = $this->getCommList($brokerId, $lat, $lng);
     // 判断经纪人是否签到过
     if ($communities) {
         $communityIds = array();
         foreach ($communities as $community) {
             $communityIds[] = $community['commId'];
         }
         // 获取当前所处签到周期
         $signedCommunities = array();
         $currentSignRange = Bll_Broker_CommunitySign::getCurrentSignRange();
         if ($currentSignRange) {
             $signs = Model_Broker_CommunitySign::data_access(date('Ym', strtotime($currentSignRange[0])))->filter('brokerId', $brokerId)->filter_by_op_multi(array(array('signTime', '>=', $currentSignRange[0]), array('signTime', '<=', $currentSignRange[1])))->get_all();
             foreach ($signs as $sign) {
                 $signedCommunities[$sign['communityId']] = $sign['communityId'];
             }
         }
         // 标记小区签到状态
         foreach ($communities as &$row) {
             if (isset($signedCommunities[$row['commId']])) {
                 $row['signed'] = 1;
             } else {
                 $row['signed'] = 0;
             }
         }
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'total' => count($communities), 'data' => $communities);
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:57,代码来源:CommSignList.php

示例7: handle_request

 /**
  * Job执行逻辑
  */
 public function handle_request()
 {
     $mail = array('quancaiwang@anjuke.com', 'caoyang@anjuke.com', 'lihuaweng@anjuke.com', 'cindyji@anjuke.com', 'linyang@anjuke.com');
     $frozenList = Model_Payment_AcFreezen::data_access()->filter('freezeEffective', 1)->filter('appid', $this->appids)->filter_by_op('createTime', '<=', $this->errorTime)->get_all();
     $re = $accountId = array();
     if ($frozenList) {
         $this->setLog('今日共' . count($frozenList));
         foreach ($frozenList as $frozen) {
             $word = $this->getWord($frozen['appid']);
             $re[$word['word']]['数量']++;
             $re[$word['word']]['金额'] += $frozen['amount'];
             $userInfo = Model_Payment_AjkUserAccount::data_access()->filter('accountId', $frozen['accountId'])->get_row();
             if (!$userInfo['userId']) {
                 continue;
             }
             $brokerInfo = Model_Broker_AjkBrokerExtend::data_access()->filter('userId', $userInfo['userId'])->get_row();
             if (!$brokerInfo['brokerId']) {
                 continue;
             }
             $brokerId = $brokerInfo['brokerId'];
             $accountId[$brokerId]['word'] = $word['word'];
             $accountId[$brokerId]['amount'] = $frozen['amount'];
             if ($this->dealFlag) {
                 //解冻处理
                 $url = $this->acenterHost . 'acenter/interfaces/?action=use&account=' . $frozen['accountId'] . '&amount=0&frozen=' . $frozen['acBalanceId'] . '&note=解冻金额&appid=' . $frozen['appid'] . '&appkey=' . $this->appInfo[$word['constWord']]['appKey'] . '&requestid=' . date('YmdHis') . mt_rand(0, 1000) . $frozen['accountId'];
                 $result = Uri_Curl::get_curl($url);
                 $this->setLog($url);
                 $this->setLog($result);
                 if ($result['result']) {
                     //解冻成功,call @马荟的查询余额接口进行数据修复
                     $balanceUrl = $this->proxyHost . 'service-exes/rest/exes/inquiry?json&appId=23&appKey=' . $this->appInfo['ajk_bid']['appKey'] . '&account=' . $frozen['accountId'];
                     $reBalance = Uri_Curl::get_curl($balanceUrl);
                     $this->setLog($balanceUrl);
                     $this->setLog($reBalance);
                     $this->setLog('account: ' . $frozen['accountId'] . ' ,业务: ' . $word['word'] . ' ,amount: ' . $frozen['amount'] . ' ,serialNumber: ' . $frozen['acBalanceId']);
                 }
             }
         }
         $str = '<table border="1"><tr><td>业务类型</td><td>数量</td><td>金额</td></tr>';
         foreach ($re as $wr => $ac) {
             $str .= '<tr><td>' . $wr . '</td><td>' . $ac['数量'] . '</td><td>' . $ac['金额'] . '</td></tr>';
         }
         $str .= '</table><br /><br /><table border="1"><tr><td>业务类型</td><td>经纪人ID</td><td>金额</td></tr>';
         foreach ($accountId as $brokerId => $ac) {
             $str .= '<tr><td>' . $ac['word'] . '</td><td>' . $brokerId . '</td><td>' . $ac['amount'] . '</td></tr>';
         }
         $str .= '</table>';
         $this->send_mail($mail, '有问题的冻结共 ' . count($frozenList), $str);
         return true;
     } else {
         $this->send_mail($mail, '今天没有有问题的冻结', '今天没有有问题的冻结');
         return true;
     }
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:57,代码来源:UnfreezeFailAcenter.php

示例8: getBrokerUserIdByBrokerId

 /**
  * 获取二手房经纪人的userId
  *
  * @param int $ajkBrokerId
  * @return int
  * @throws Exception
  */
 public static function getBrokerUserIdByBrokerId($ajkBrokerId)
 {
     $dataAccess = Model_Broker_AjkBrokerExtend::data_access();
     $dataAccess->filter('brokerId', $ajkBrokerId);
     $dataAccess->load_field(array('userId'));
     $row = $dataAccess->get_row();
     if (empty($row)) {
         throw new Exception(sprintf('没有获取到经纪人[%d]信息', $ajkBrokerId));
     }
     return intval($row['userId']);
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:18,代码来源:Broker.php

示例9: handle_request_internal

 public function handle_request_internal()
 {
     /**
      * 00:00
      *  获取前一天20:00 以后
      * 10:00
      *  获取10:00 以后
      * 15:00
      *  获取15:00 以后
      * 20:00
      *  获取20:00 以后
      *
      */
     // 获取参数;
     $commId = $this->_params['commId'];
     // 根据ID获取小区
     $community = Bll_Community_APIComm::getInstance()->getInfoByIdMapping($commId, 2);
     if (!$community || !$community['sosolat'] || !$community['sosolng']) {
         throw new Exception('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     $data = array();
     if (Bll_Broker_CommunitySign::isTopSignerActivityOngoing()) {
         $hour = intval(date('H'));
         if ($hour >= 0 && $hour < 10) {
             $theSignRange = array(date('Y-m-d 20:00:00', strtotime('-1 day')), date('Y-m-d 23:59:59', strtotime('-1 day')));
         } elseif ($hour >= 10 && $hour < 15) {
             $theSignRange = array(date('Y-m-d 10:00:00'), date('Y-m-d 14:59:59'));
         } elseif ($hour >= 15 && $hour < 20) {
             $theSignRange = array(date('Y-m-d 15:00:00'), date('Y-m-d 19:59:59'));
         } else {
             $theSignRange = array(date('Y-m-d 20:00:00'), date('Y-m-d 23:59:59'));
         }
         $brokerInfos = Bll_Commsign::getFirstThr($commId, $theSignRange[0]);
         //var_dump($data);exit;
         $data = array();
         if (!empty($brokerInfos)) {
             foreach ($brokerInfos as $k => $v) {
                 $brokerTmp = Bll_Commsign::getBrokerInfo($v['brokerId']);
                 if (!$brokerTmp) {
                     $broker = Model_Broker_AjkBrokerExtend::data_access()->filter('brokerId', $v['brokerId'])->find_only();
                     $broker_photo = Util_ImageUtils::get_broker_photo_url($broker['userPhoto'], '200x200');
                     $brokerTmp = array('brokerId' => $broker['brokerId'], 'username' => $broker['trueName'], 'userPhoto' => $broker_photo, 'cityId' => $broker['cityId']);
                     Bll_Commsign::redisBrokerInfo($v['brokerId'], $brokerTmp);
                 }
                 if (empty($brokerTmp['userPhoto'])) {
                     $brokerTmp['userPhoto'] = PageHelper::pure_static_url('/img/bknoimg.gif');
                 }
                 $dataTmp = array('brokerId' => $brokerTmp['brokerId'], 'brokerTrueName' => $brokerTmp['username'], 'brokerPhoto' => $brokerTmp['userPhoto']);
                 $data[] = $dataTmp;
             }
         }
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data);
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:54,代码来源:CommSignTopSigner.php

示例10: handle_request_internal

 public function handle_request_internal()
 {
     $userId = $this->_params['userId'];
     // TODO 校验用户是否存在
     $brokerInfo = Model_Broker_AjkBrokerExtend::data_access()->filter('userId', $userId)->find_only();
     if (!$brokerInfo) {
         throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     $data = self::getFykStatus(intval($userId), $brokerInfo['cityId']);
     return API_Result::create()->ok()->data($data)->toArray();
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:11,代码来源:Privileges.php

示例11: handle_request_internal

 public function handle_request_internal()
 {
     //4.3之前版本的兼容性处理,此api之后将废弃
     header("Access-Control-Allow-Origin: *");
     return array('status' => 'error', 'errcode' => Const_APIStatus::E_FYK_USER_ACTIVATION_CODE_CLOSE, 'message' => '此功能已关闭');
     $userId = $this->_params['userId'];
     // TODO 校验用户是否存在
     $brokerInfo = Model_Broker_AjkBrokerExtend::data_access()->filter('userId', $userId)->find_only();
     if (!$brokerInfo) {
         throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     $codeInfo = Model_Fyk_InvitationCodes::data_access()->filter(Model_Fyk_InvitationCodes::BIND_TO, $userId)->get_row();
     if (empty($codeInfo)) {
         return API_Result::create()->error()->errorCode('9999')->message('邀请码错误')->toArray();
     }
     return API_Result::create()->ok()->data(array('code' => $codeInfo['code']))->toArray();
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:17,代码来源:GetInvitationCode.php

示例12: handle_request_internal

 public function handle_request_internal()
 {
     $userId = $this->_params['userId'];
     $mobile = $this->_params['mobile'];
     $status = $this->_params['status'];
     if (!$userId) {
         $brokerInfo = Model_Broker_AjkBrokerExtend::data_access()->filter('userMobile', $mobile)->find_only();
     } else {
         $brokerInfo = Model_Broker_AjkBrokerExtend::data_access()->filter('userId', $userId)->find_only();
     }
     if (!$brokerInfo) {
         throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     $userId = $brokerInfo->userId;
     try {
         Model_Fyk_Users::data_access()->set_field(Model_Fyk_Users::STATUS, $status)->filter(Model_Fyk_Users::USER_ID, $userId)->update();
     } catch (Exception $e) {
         return API_Result::create()->error()->errorCode('9999')->message('修改房源库权限失败')->toArray();
     }
     return API_Result::create()->ok()->data(array('message' => '修改成功'))->toArray();
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:21,代码来源:ModifyStatus.php

示例13: handle_request_internal

    public function handle_request_internal(){
        $mobile = $this->_params['mobile'];
        $price  = $this->_params['price'];
        $brokerInfo = Model_Broker_AjkBrokerExtend::data_access()
            ->filter('userMobile', $mobile)
            ->find_only();

        if (!$brokerInfo) {
            return API_Result::create()->error()->errorCode('9999')->message('经纪人不存在')->toArray();
        }

        $userId = $brokerInfo->userId;
        $userAccountId = Bll_Fyk_Payment_User::getInstance()->getUserAccountId($userId);
        if (empty($userAccountId)) {
            return API_Result::create()->error()->message('没有用户支付中心ID')->toArray();
        }
        $addArr = array(
            'userId'     => $userId,
            'propId'     => 0,
            'price'      => $price,
            'requestId'  => 0,
            'actionMsg'  => '',
            'actionCode' => Const_Fyk::USER_RECHARGE_BY_SYSTEM,
            'status'     => Model_Fyk_MoneyActionQueue::STATUS_NODEAL,
            'createTime' => time()
        );
        $id = Model_Fyk_MoneyActionQueue::getInstance()->insertData($addArr);
        if($id){
            return API_Result::create()
                ->ok()
                ->toArray();
        } else {
            return API_Result::create()
                ->error()
                ->message('插入系统加钱队列失败')
                ->toArray();
        }
    }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:38,代码来源:SystemAddMoney.php

示例14: handle_request_internal

 public function handle_request_internal()
 {
     /**
      * 签到小区详情
      *
      * - 验证参数
      *
      *
      * - 获取经纪人
      *
      * - 获取小区(AjkCommunity)
      * -
      *
      * - 获取小区签到人数
      *
      * - 判断经纪人是否可签到(经纪人是否已签到、当前是否在签到时间段)
      * - 校验小区坐标和lat、lng的距离5公里,超出不可签到(如小区无坐标,不可签到)
      *
      * - 计算距离下一时间点的签到倒计时(单位:s)
      *
      * - 获取小区各个时间段签到前3名
      *
      * - 返回数据
      */
     // 获取参数
     $brokerId = $this->_params['brokerId'];
     $commId = $this->_params['commId'];
     $lat = $this->_params['lat'];
     $lng = $this->_params['lng'];
     // 根据ID获取经纪人
     $broker = Bll_Commsign::getBrokerInfo($brokerId);
     if (!$broker) {
         $broker = Model_Broker_AjkBrokerExtend::data_access()->filter('brokerId', $brokerId)->find_only();
         if (!$broker) {
             throw new Exception('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
         }
         $broker_photo = Util_ImageUtils::get_broker_photo_url($broker['userPhoto'], '200x200');
         $brokerInfo = array('brokerId' => $broker['brokerId'], 'username' => $broker['trueName'], 'userPhoto' => $broker_photo, 'cityId' => $broker['cityId']);
         Bll_Commsign::redisBrokerInfo($brokerId, $brokerInfo);
     }
     // 根据ID获取小区
     $community = Bll_Commsign::getCommInfo($commId);
     if (empty($community)) {
         $community = Bll_Community_APIComm::getInstance()->getInfoByIdMapping($commId, 2);
         $commInfo = array();
         $commInfo['commId'] = $community['commId'];
         $commInfo['commName'] = $community['commName'];
         $commInfo['sosolng'] = $community['sosolng'];
         $commInfo['sosolat'] = $community['sosolat'];
         Bll_Commsign::setCommInfo($commId, $commInfo);
     }
     if (!$community || !$community['sosolat'] || !$community['sosolng']) {
         throw new Exception('小区不存在', Const_APIStatus::E_COMMUNITY_NOT_EXISTS);
     }
     // 获取小区签到人数
     $communitySignCount = Bll_Commsign::getCommCount($commId);
     // 判断经纪人是否可签到
     $signAble = true;
     $currentSignRange = Bll_Broker_CommunitySign::getCurrentSignRange();
     if (!$currentSignRange) {
         $signAble = false;
     } else {
         // 经纪人是否已经签过到
         if (Bll_Commsign::isSignedAlready($brokerId, $commId, $currentSignRange[0])) {
             $signAble = false;
         }
     }
     // 对比小区坐标和参数坐标两点的距离(5km)
     $distance = Util_Map::distance($lat, $lng, $community['sosolat'], $community['sosolng']);
     if ($distance > 5000) {
         $signAble = false;
     }
     $data = array();
     $data['signAble'] = intval($signAble);
     $data['signCount'] = $communitySignCount;
     $data['countDown'] = $signAble ? 0 : Bll_Broker_CommunitySign::nextSignCountDown();
     $data['signList'] = array();
     // 获取各时间段签到前三名
     if (Bll_Broker_CommunitySign::isTopSignerActivityOngoing()) {
         $data['signList'] = array(array('hour' => '10:00', 'brokers' => array()), array('hour' => '15:00', 'brokers' => array()), array('hour' => '20:00', 'brokers' => array()));
         foreach ($data['signList'] as &$theSignList) {
             $theHour = intval($theSignList['hour']);
             $hour = intval(date('H'));
             if ($hour >= 0 && $hour < 10) {
                 break;
             } elseif ($hour >= 10 && $hour < 20) {
                 if ($theHour > $hour) {
                     continue;
                 }
             }
             $theSignRange = array();
             switch ($theHour) {
                 case 10:
                     $theSignRange = array(date('Y-m-d 10:00:00'), date('Y-m-d 14:59:59'));
                     break;
                 case 15:
                     $theSignRange = array(date('Y-m-d 15:00:00'), date('Y-m-d 19:59:59'));
                     break;
                 case 20:
                     $theSignRange = array(date('Y-m-d 20:00:00'), date('Y-m-d 23:59:59'));
//.........这里部分代码省略.........
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:101,代码来源:CommSignDetail.php

示例15: insertQueue

 /**
  * 插入返钱队列
  *
  * @return array
  */
 public function insertQueue()
 {
     $typeId = APF::get_instance()->get_request()->get_parameter('typeId');
     $brokerId = APF::get_instance()->get_request()->get_parameter('brokerId');
     $cityId = APF::get_instance()->get_request()->get_parameter('cityid');
     $remark = APF::get_instance()->get_request()->get_parameter('remark');
     $amount = APF::get_instance()->get_request()->get_parameter('amount');
     $mobile = APF::get_instance()->get_request()->get_parameter('mobile');
     //验证手机号和经纪人id的正确性
     $brokerInfo = Model_Broker_AjkBrokerExtend::data_access()->filter_by_op('userMobile', '=', $mobile)->find_only();
     if (empty($brokerInfo)) {
         return array('status' => 'fail', 'info' => '对应手机号对应的经纪人不存在');
     }
     if ($brokerInfo->brokerId != $brokerId) {
         return array('status' => 'fail', 'info' => '手机号与经纪人id不符');
     }
     $sqlResult = Model_Broker_AjkPppccoinQueen::data_access()->force_master()->filter_by_op('typeid', '=', $typeId)->filter_by_op('brokerid', '=', $brokerId)->find_only();
     if ($sqlResult) {
         return array('status' => 'fail', 'info' => '该经纪人当天已有一条返还记录');
     }
     $mysqlAccessor = new Model_Broker_AjkPppccoinQueen();
     $mysqlAccessor->brokerid = $brokerId;
     $mysqlAccessor->cityid = $cityId;
     $mysqlAccessor->typeid = $typeId;
     $mysqlAccessor->remark = $remark;
     $mysqlAccessor->amount = $amount;
     $mysqlAccessor->addtime = time();
     $mysqlAccessor->save();
     return array('status' => 'success', 'info' => 'insert success');
 }
开发者ID:emilymwang8,项目名称:ajk-broker,代码行数:35,代码来源:BackQueue.php


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