public function handle_request_internal() { if ($this->_params['offer']) { $post = array('brokerId' => $this->_params['brokerId'], 'budget' => $this->_params['budget'] * 100, 'offer' => $this->_params['offer'] * 100, 'propId' => $this->_params['propId']); } $city_info = Dao_Broker_BrokerInfo::get_broker_base_info(intval($this->_params['brokerId'])); if (!Bll_City::isBidCity($city_info['CITYID'])) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } if (!empty($this->_params['offer'])) { $offerStr = (string) $this->_params['offer']; if (strpos($offerStr, ".") !== false) { $offerArr = explode('.', $offerStr); if (strlen($offerArr[1]) > 1) { return Util_MobileAPI::error_tmp("3016", "竞价出价最小单位为角"); } } } $api_url = '/service-ppc/rest/hp/createHPlan'; $result = Util_CallAPI::get_data_from_java_api($api_url, $post); if ($result['data']['status'] == 'ok') { $return = array('status' => 'ok', 'data' => array()); } else { $return = Util_MobileAPI::error(self::changeJavaAPICodeToSelfCode($result['data']['code'])); } return $return; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $propId = $this->_params['propId']; $budget = $this->_params['budget']; $offer = $this->_params['offer']; $city_info = Dao_Broker_BrokerInfo::get_broker_base_info(intval($this->_params['brokerId'])); if (!Bll_City::isBidCity($city_info['CITYID'])) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } $planInfo = $this->get_hpplan_info($propId); $post = array('brokerId' => $brokerId, 'propId' => $propId, 'budget' => $budget * 100 - $planInfo['budget'], 'offer' => $offer * 100, 'from' => APF::get_instance()->get_config('java_api_from')); $url = '/service-ppc/rest/hp/updHPlan'; $data = Util_CallAPI::get_data_from_java_api($url, $post); if ($data['data']['status'] === 'ok') { $ret = array('status' => 'ok', 'data' => array()); } else { $errcode = $data['data']['code']; $translate_errcode = $this->my_err_code($errcode); if ($translate_errcode === FALSE) { $ret = Util_MobileAPI::error_tmp($data['data']['code'], $data['data']['info']); } else { $ret = Util_MobileAPI::error($translate_errcode); } } return $ret; }
public function handle_request() { if (file_exists($this->startBrokerIdLogFile) && is_readable($this->startBrokerIdLogFile)) { $this->startBrokerId = intval(file_get_contents($this->startBrokerIdLogFile)); } if ($this->startBrokerId == 0) { $this->getFirstBrokerId(); } $this->distributionPrizeLogFile = sprintf('/data1/logs/User_DistributionPrize-%d.log', date('Ymd')); $this->distributionPrizeErrorFile = sprintf('/data1/logs/User_DistributionPrize-%d.error', date('Ymd')); $this->getLastBrokerId(); $this->PPCCoinTypeId = $this->getPPCCoinTypeId(); for (; $this->startBrokerId <= $this->endBrokerId; $this->startBrokerId++) { file_put_contents($this->startBrokerIdLogFile, $this->startBrokerId); $luckyDrawLogList = $this->getLuckyDrawAwardLog($this->startBrokerId); if (empty($luckyDrawLogList)) { continue; } $amount = 0; $brokerName = $luckyDrawLogList[0]['user_name']; $remark = $this->calculateBackCoinAmount($luckyDrawLogList, $amount); if ($amount == 0) { continue; } $logMsg = "BrokerId: {$this->startBrokerId}\tBrokerName: {$brokerName}\tAmount: {$amount}\tRemark: {$remark}\n"; file_put_contents($this->distributionPrizeLogFile, $logMsg, FILE_APPEND); $brokerInfo = Dao_Broker_BrokerInfo::get_broker_base_info($this->startBrokerId); if (empty($brokerInfo)) { file_put_contents($this->distributionPrizeErrorFile, $logMsg, FILE_APPEND); continue; } $cityId = $brokerInfo['CITYID']; $this->saveToQueue($this->startBrokerId, $amount, '积分行动现金奖品派发:' . $remark, $cityId); } }
/** * 根据好租经纪人ID获取ajk user_id */ public static function get_userid_by_hzbrokerid($broker_id) { //取ajk经纪人ID $ajk_brokerid = Dao_Broker_BrokerInfo::get_ajk_from_mapping($broker_id); //取ajk经纪人信息 $info = Dao_Broker_BrokerInfo::get_broker_base_info($ajk_brokerid['AJKBROKERID']); return $info ? $info['USERID'] : 0; }
public function handle_request_internal() { //上海不让竞价 $city_info = Dao_Broker_BrokerInfo::get_broker_base_info(intval($this->_params['brokerId'])); if (!Bll_City::isBidCity($city_info['CITYID'])) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } $post = array('brokerId' => $this->_params["brokerId"], 'propId' => $this->_params["propId"], 'from' => APF::get_instance()->get_config('java_api_from')); $url = '/service-ppc/rest/hp/stopHPlan'; $data = Util_CallAPI::get_data_from_java_api($url, $post); if ($data['data']['status'] === 'ok') { $ret = array('status' => 'ok', 'data' => array()); } else { $errcode = $data['data']['code']; $translate_errcode = $this->my_err_code($errcode); return Util_MobileAPI::error($translate_errcode); } return $ret; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; //上海不让竞价 $city_info = Dao_Broker_BrokerInfo::get_broker_base_info(intval($this->_params['brokerId'])); //get bid flg for city $choiceCityFlag = Bll_City::isChoiceCity($city_info['CITYID']); if ($choiceCityFlag) { return array('status' => 'ok', 'data' => array('propertyList' => array(), 'codeNum' => Const_HzErrorInfo::NOBIDCITY)); } $url = '/service-ppc/rest/hp/brokerHPlans?brokerId=' . $brokerId . '&resType=1&tradeType=1'; $data = Util_CallAPI::get_data_from_java_api($url); if ($data['data']['status'] === 'ok') { $props = array(); if (is_array($data['data']['planProp'])) { $proids = $props_info = array(); foreach ($data['data']['planProp'] as $prop) { $proids[$prop['propId']] = $prop['propId']; $props_info[$prop['propId']] = $prop; } $proid_str = implode(',', $proids); $props['propertyList'] = $this->get_prop_info_new($proid_str, $brokerId, $props_info); $a = function ($a, $b) { if ($a['id'] == $b['id']) { return 0; } return $a['id'] < $b['id'] ? -1 : 1; }; usort($props['propertyList'], $a); } else { $props['propertyList'] = array(); } $ret = array('status' => 'ok', 'data' => $props); } else { $ret = Util_MobileAPI::error_tmp($data['data']['code'], $data['data']['info']); } return $ret; }
/** * app 获取经纪人基础信息 */ public static function get_broker_baseinfo_app($broker_id) { $base_info = Dao_Broker_BrokerInfo::get_broker_base_info($broker_id); if (empty($base_info)) { return array(); } //头像状态 $usrPhotoState = $base_info['USRPHOTOSTATE']; $usrPhotoTmpState = $base_info['USRPHOTOTMPSTATE']; $userPhotoTmp = $base_info['USERPHOTOTMP']; $userPhoto = $base_info['USERPHOTO']; $imageUrl = ''; $photoStaus = 0; if ($usrPhotoState == 2 || $usrPhotoTmpState == 1) { $photoStaus = 1; //已认证 $imageUrl = Util_DisplayImages::get_img_url($userPhoto, -1, '100x133'); } elseif ($usrPhotoState == 0 && empty($userPhoto) && empty($userPhotoTmp)) { $photoStaus = 0; //未认证 } elseif ($usrPhotoState == 1 || $usrPhotoTmpState == 0 && !empty($userPhotoTmp)) { $photoStaus = 2; //认证中 } elseif ($usrPhotoState == 3 || $usrPhotoTmpState == 2) { $photoStaus = 3; //认证失败 } //身份证状态 $usrCardState = $base_info['USRCARDSTATE']; $userCardFile = $base_info['USERCARDFILE']; $userCardStatus = 0; if ($usrCardState == 0 && empty($userCardFile)) { $userCardStatus = 0; //未认证 } elseif ($usrCardState == 1) { $userCardStatus = 2; //认证中 } elseif ($usrCardState == 2) { $userCardStatus = 1; //已认证 } elseif ($usrCardState == 3) { $userCardStatus = 3; //认证失败 } //名片状态 $bnsCardState = $base_info['BNSCARDSTATE']; $bnsCardStatus = 0; $lastupdata = Bll_BrokerBaseBll::get_instance()->getLastPostBnsCardFile($broker_id); $isPass = $lastupdata['IsPass']; if (empty($lastupdata)) { //没认证 $bnsCardStatus = 0; } else { if ($base_info['CHECKSTATE'] == 0) { switch ($bnsCardState) { case 1: //认证中 $bnsCardFile $bnsCardStatus = 2; break; case 2: //已认证 $bnsCardFile $bnsCardStatus = 1; break; case 3: //认证失败 $bnsCardFile $bnsCardStatus = 3; break; } } elseif ($base_info['CHECKSTATE'] == 1) { if ($isPass == 0) { //认证中 FileName $bnsCardStatus = 2; } elseif ($isPass == 1) { //已认证 FileNam $bnsCardStatus = 1; } elseif ($isPass == 2) { //认证失败 FileName $bnsCardStatus = 3; } } } //城市 $citys = array(); $citys_tmp = Dao_Broker_BrokerInfo::get_citys(); foreach ($citys_tmp as $city) { $citys[$city['CITYID']] = $city['TYPENAME']; } //门店 if ($base_info['CST_BROKER_COMPANY_ID'] != 0) { $cst_commpany = Dao_Broker_BrokerInfo::get_cst_company($base_info['CST_BROKER_COMPANY_ID']); } else { $cst_commpany['COMANYNAME'] = ""; } //区域板块 $area = Dao_Broker_BrokerInfo::get_comm(substr($base_info['AREACODE'], 4, 4)); $block = Dao_Broker_BrokerInfo::get_comm(substr($base_info['AREACODE'], 8, 4)); $return['brokerName'] = $base_info['TRUENAME']; $return['phone'] = $base_info['USERMOBILE']; $return['city_id'] = $base_info['CITYID']; $return['cityName'] = $citys[$base_info['CITYID']]; // 城市名 $return['workRegion'] = $area['TYPENAME'] . ' ' . $block['TYPENAME']; //工作区域 //获取所属公司 $com = Model_Broker_CstCompany::getCompanyNameById($base_info['COMPANYID']); $return['company'] = $com['CompanyName']; //所属公司 $return['store'] = $cst_commpany['COMANYNAME']; //所属门店 $return['display'] = ""; $return['bnsCardStatus'] = $bnsCardStatus; $return['userCardStatus'] = $userCardStatus; $return['userPhotoStatus'] = $photoStaus; $return['imageUrl'] = $imageUrl; $return['userId'] = $base_info['USERID']; //账户余额 $hzbroker_id = Bll_HzBroker::get_brokerid_by_ajk_brokerid($broker_id); if (!$hzbroker_id) { $hzbroker_id = $broker_id; } $broker_money = Bll_PayAccount::get_broker_balance($hzbroker_id); $return['balance'] = sprintf("%.2f", $broker_money); return $return; }
public function insertProPlanChange($arr, $operate_id = 0) { //数据来源标记不能为空 if (!isset($arr['from']) || empty($arr['from'])) { return array('status' => 'err', 'msg' => '参数from不能为空'); } //数据网站类型判断 if (!isset($arr['site_type']) || !in_array($arr['site_type'], array(1, 2, 3, 4))) { return array('status' => 'err', 'msg' => '参数site_type不能为空或错误'); } $classInfo = new ReflectionClass('Const_ProPlanChangeType'); $type = $classInfo->getConstant(strtoupper($arr['type'])); if ($type === false) { return array('status' => 'err', 'msg' => '未知的动作类型'); } $arr['type'] = $type; //选传字段 if (isset($arr['pro_id'])) { if (empty($arr['pro_id'])) { unset($arr['pro_id']); } elseif (!is_numeric($arr['pro_id'])) { return array('status' => 'err', 'msg' => '参数pro_id错误'); } } if (isset($arr['plan_id'])) { if (empty($arr['plan_id'])) { unset($arr['plan_id']); } elseif (!is_numeric($arr['plan_id'])) { return array('status' => 'err', 'msg' => '参数plan_id错误'); } } /** 无须Check经纪人信息 */ $notCheckBroker = array(Const_ProPlanChangeType::PRICE_INTERVAL_CHANGE, Const_ProPlanChangeType::PRICE_INTERVAL_ADD, Const_ProPlanChangeType::BUILDING_AREA_CHANGE, Const_ProPlanChangeType::PROPERTY_AREA_CHANGE, Const_ProPlanChangeType::COMMUNITY_INFO_CHANGE_EX, Const_ProPlanChangeType::COMM_MERGE); if (!in_array($type, $notCheckBroker)) { //参数判断(处理),必传字段 if (!isset($arr['broker_id']) || empty($arr['broker_id'])) { return array('status' => 'err', 'msg' => '参数broker_id不能为空'); } $DaoBrokerInfo = new Dao_Broker_BrokerInfo(); $broker_info = $DaoBrokerInfo->get_broker_base_info($arr['broker_id']); if (empty($broker_info)) { return array('status' => 'err', 'msg' => '未知的经纪人'); } if (!($broker_info['PAYTYPE'] == 9999 || $broker_info['PAYTYPE'] == 10000)) { return array('status' => 'err', 'msg' => '经纪人非ppc经纪人'); } $arr['city_id'] = $broker_info['CITYID']; } else { $remark = json_decode($arr['remark'], true); if (!is_array($remark) || !isset($remark['cityId'])) { return array('status' => 'err', 'msg' => 'remark 必须是JSON,有cityId字段'); } $arr['city_id'] = intval($remark['cityId']); } $arr['add_date'] = time(); $arr['flag'] = 0; $arr['operate_id'] = is_numeric($operate_id) ? $operate_id : 0; $arr['remark'] = $this->getPlanStatusRemark($arr['pro_id'], $arr['city_id'], $arr['remark'], $arr['type'], $arr['site_type']); //数据写入 if (!DAO_Plan_qHpProPlanChange::insertqHpProPlanChange($arr, date('Ymd'))) { return array('status' => 'err', 'msg' => '数据写入失败'); } return array('status' => 'ok'); }
public function push($brokerId, $msg, $entrustId, $entrustType) { // 如果经纪人禁用了抢房源消息推送,直接返回 if (Bll_Broker_AppSwitch::isOff($brokerId, Const_AppSwitch::TYPE_ENTRUST_PUSH)) { return false; } $broker_info = Dao_Broker_BrokerInfo::get_broker_base_info($brokerId); if (!empty($broker_info) && preg_match('/^1((3[0-9])|(4[0-9])|(5[0-9])|(7[0-9])|(8[0-9]))[0-9]{8}$/', $broker_info['USERMOBILE'])) { $api_host = APF::get_instance()->get_config('chat_api_host'); $api_url = $api_host['host'] . '/user/brokerSearch/' . $broker_info['USERMOBILE'] . '?from_idc=1&from=mobile-ajk-broker'; $result = Util_API::getData($api_url, ''); if ($result['status'] == 'OK' && intval($result['result']['user_id']) > 0) { $cv = APF::get_instance()->get_config("free_entrust_min_cv"); $chatId = intval($result['result']['user_id']); $this->message[] = array('user_id' => $chatId, 'message' => $msg, 'msgType' => 'push', 'type' => 'commission', 'min_cv' => $cv, 'eId' => $entrustId, 'eType' => $entrustType, 'body' => array('type' => 'commission', 'msg' => $msg, 'entrustId' => $entrustId, 'entrustType' => $entrustType)); return true; } return false; } return false; }
/** * 创建log * @param $logInfo */ private function createLog($logInfo) { if (!$logInfo) { return false; } $accountId = $logInfo['account_id']; //获取用户信息 if (!($accountInfo = BLL_Payment_Account::getAccountMapping($accountId))) { echo 'balbanceLogId=' . $logInfo['id'] . ',获取accountInfo信息失败:$accountId=' . $accountId . PHP_EOL; return false; } $accountInfo = (array) $accountInfo; // 初始参数 $userId = $accountInfo['userId']; $createTime = $logInfo['created_time']; $logDay = date("Ymd", strtotime($createTime)); $amount = $logInfo['amount']; $inTable = false; // 是否写入子表 $isStatic = false; // 是否定价 $logType = $logInfo['log_type']; //只有定价扣费和退费才进子表 //定价扣费 if ($logInfo['log_type'] == 2) { if (in_array($logInfo['appid'], array(26, 47, 48, 30, 40))) { if (in_array($logInfo['appid'], array(30, 40)) && strstr($logInfo['note'], '定价') !== false) { $inTable = true; $isStatic = true; } elseif (in_array($logInfo['appid'], array(26, 47, 48))) { $inTable = true; $isStatic = true; } else { $logType = 8; //竞价 } } else { $logType = 8; //竞价 } } //退费 if ($logInfo['log_type'] == 1 && ($logInfo['parentId'] == $logInfo['orderid'] && intval($logInfo['parentId'] > 0)) && $logInfo['account_id'] == $logInfo['payid']) { $inTable = true; $logType = 7; } $note = $logInfo['note']; // 在线充值 if (substr($note, 0, strlen('from ')) == 'from ') { $note = '在线充值'; } elseif ($logType == 1 && strpos($note, '返还') !== false) { //$note = '活动返还'; } elseif ($logType == 7) { $note = '无效点击扣费返还'; } elseif ($isStatic) { $note = '定价推广消费'; } // 加钱 if (in_array($logType, array(1, 4, 6, 7))) { if (!($broker = Dao_Broker_BrokerInfo::getBrokerInfoByUserId($userId))) { echo 'balbanceLogId=' . $logInfo['id'] . ',获取broker信息失败:userid=' . $userId . PHP_EOL; return false; } $cityId = $broker['CITYID']; $brokerId = $broker['BROKERID']; $isNotify = false; if ($logType == 4) { $result = $this->getBalance($accountInfo); if ($result['status'] == 'ok') { if ($result['data']['balance'] > 0) { $isNotify = true; } } } else { $isNotify = true; } if ($isNotify) { // 通知租房 金浦 //$this->notifyZufang($brokerId, $amount);//20140626 启用新队列 //$this->notifyJinpu($brokerId, $amount);//20140626 启用新队列 // 通知安居客上架 //if (!Bll_House_AjkHpProSpread::insertProSpreadChange(0, 0, $brokerId, $cityId, 7, '支付中心日志同步:加钱', __CLASS__)) { // echo 'balbanceLogId=' . $logInfo['id'] . '通知安居客上架失败' . PHP_EOL; // return false; //} $ProPlanChangeApiBll = Bll_ProPlanChangeApiBll::get_instance(); $Result = $ProPlanChangeApiBll->insertProPlanChange(array('broker_id' => $brokerId, 'pro_id' => 0, 'plan_id' => 0, 'type' => 'BROKER_HAVE_MONEY', 'from' => __CLASS__, 'remark' => '支付中心日志同步:加钱;logType:' . $logType, 'site_type' => 4), 0); if ($Result['status'] != 'ok') { echo 'balbanceLogId=' . $logInfo['id'] . '通知安居客上架失败,msg:' . $Result['msg'] . PHP_EOL; } } } // 账户钱变多, 通知生命周期队列 if ($logType == 1) { //推广动作触发表 if (!Bll_Broker_User::insertLifeQueen(array('BrokerId' => $brokerId, 'Type' => 2))) { echo 'balbanceLogId=' . $logInfo['id'] . '通知生命周期队列失败' . PHP_EOL; } } $isHaved = false; // 是否插入过 if ($inTable) { if (Bll_Broker_BrokerAccountParticulars::getBalanceLogSubByAcenterId($logInfo['id'], $logDay)) { $isHaved = true; } } else { if (Bll_Broker_BrokerAccountParticulars::getBalanceLogByAcenterId($logInfo['id'], $logDay)) { $isHaved = true; } } // 重跑, 如果有记录则跳过 if (!$isHaved) { $result = null; if ($inTable) { $result = (array) Bll_Broker_BrokerAccountParticulars::getBalanceLogWithCache($userId, $logType, $logDay); } if ($result) { //消费和退费 $id = $result['id']; if ($createTime >= $result['createTimeEnd']) { $createdTimeEnd = $createTime; } else { $createdTimeEnd = date('Y-m-d H:i:s'); } // 更新账户日志 if (!Bll_Broker_BrokerAccountParticulars::updateBalanceLogById($id, $amount, $note, $createdTimeEnd)) { echo 'balbanceLogId=' . $logInfo['id'] . ',账户日志更新失败' . PHP_EOL; return false; } } else { // 新增账户日志 if (!$userId) { echo '+++++userid为空:'; var_dump($userId); echo PHP_EOL . '支付中心账户日志id:' . $logInfo['id'] . ';获取$accountInfo为:'; var_dump($accountInfo); echo PHP_EOL; } if (!($id = Bll_Broker_BrokerAccountParticulars::insertBalanceLog($userId, $amount, $logType, $note, $logDay, $createTime, $logInfo['id']))) { echo 'balbanceLogId=' . $logInfo['id'] . ',账户日志新增失败' . PHP_EOL; return false; } } } else { if (!$inTable) { echo 'balbanceLogId=' . $logInfo['id'] . ',已经存在表中' . PHP_EOL; return true; } } if ($inTable) { //消费和退费 // 重跑 判断子表是否有, 有则直接返回 if ($isHaved) { echo 'balbanceLogId=' . $logInfo['id'] . ',已经存在子表中' . PHP_EOL; } // 插入子表 if (!($id = Bll_Broker_BrokerAccountParticulars::insertBalanceLogSub($id, $userId, $accountId, $amount, $logType, $logInfo['note'], $createTime, $logInfo['id']))) { echo 'balbanceLogId=' . $logInfo['id'] . ',账户子日志新增失败' . PHP_EOL; } } }
private function getBlockName($type_id) { $result = Dao_Broker_BrokerInfo::get_comm($type_id); return $result['TYPENAME']; }
/** * 获取经纪人在售房源数 */ public function getBrokerOnSale($broker_id) { $bll = new Dao_Broker_BrokerInfo(); $info = $bll->get_broker_on_sale($broker_id); return $info['ONSALE']; }
public function handle_request() { $objRequest = APF::get_instance()->get_request(); //获取brokerID self::$intBrokerID = $objRequest->getBrokerId(); //判断是否登录 if (!self::$intBrokerID) { echo json_encode(array('success' => true, 'status' => self::$NOT_LOGIN_STATUS)); return false; } //时间开关 $is_christmas_test = APF::get_instance()->get_config('is_christmas_test', 'christmas'); if (!$is_christmas_test) { //是否在活动时间 if (date("Ymd") != '20131225') { echo json_encode(array('success' => true, 'status' => self::$NOT_HIT_EGG_TIME_STATUS)); exit; } } //获取经纪人信息 self::$BrokerInfo = Dao_Broker_BrokerInfo::get_broker_base_info(self::$intBrokerID); //判断锤子数量够不够 $hammer_num = Model_Christmas_BrokerHammer::get_hammer_num(self::$intBrokerID); //如果锤子不够直接返回锤子不够 if ($hammer_num <= 0) { echo json_encode(array('success' => true, 'status' => self::$NO_HAMMER_STATUS)); return false; } //获得水机数 $random_num = mt_rand(self::$PRIZE_MIN, self::$PRIZE_MAX); $time_slot = $this->get_now_time_slot(); //当前时间段的大奖 if ($time_slot == 1) { //第二时间段(0点到9点) $big_prize_type = Model_Christmas_PrizeLog::CHRISTMAS_PRIZE_TYPE_3; } elseif ($time_slot == 2) { //第二时间段(9点到11点) $big_prize_type = Model_Christmas_PrizeLog::CHRISTMAS_PRIZE_TYPE_1; } elseif ($time_slot == 3) { //第三时间段(11点到13点) $big_prize_type = Model_Christmas_PrizeLog::CHRISTMAS_PRIZE_TYPE_2; } elseif ($time_slot == 4) { //第四时间段(13点到15点) $big_prize_type = Model_Christmas_PrizeLog::CHRISTMAS_PRIZE_TYPE_3; } elseif ($time_slot == 5) { //第五时间段(15点到17点) $big_prize_type = Model_Christmas_PrizeLog::CHRISTMAS_PRIZE_TYPE_2; } elseif ($time_slot == 6) { //第六时间段(17点到20点) $big_prize_type = Model_Christmas_PrizeLog::CHRISTMAS_PRIZE_TYPE_1; } else { echo json_encode(array('success' => true, 'status' => self::$NOT_HIT_EGG_TIME_STATUS)); return false; } //使用锤子,也就是锤子数-1 Model_Christmas_BrokerHammer::use_hammer(self::$intBrokerID); //写使用锤子日志 $this->write_hammer_log(self::$intBrokerID, -1, $random_num); //砸蛋 $this->hit_the_egg($random_num, $big_prize_type); echo json_encode(array('success' => true, 'status' => self::$NO_PRIZE_STATUS)); return false; }
public function checkInputValid($action) { switch ($action) { case 'deleteHouses': $jpBrokerId = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerId($this->brokerId)->id; if (!$jpBrokerId) { $this->outPut(0, '金铺经纪人信息有误'); } if (empty($this->params['houseIds'])) { $this->outPut(0, '房源信息有误'); } $this->jpBrokerId = $jpBrokerId; break; case 'houseCombo': $jpBrokerId = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerId($this->brokerId)->id; if (!$jpBrokerId) { $this->outPut(0, '金铺经纪人信息有误'); } //是否套餐经纪人 $broker_info = Dao_Broker_BrokerInfo::get_broker_base_info($this->brokerId); if ($broker_info['PAYTYPE'] != 9999) { $this->outPut(0, '经纪人信息有误'); } if (empty($this->params['houseIds'])) { $this->outPut(0, '房源信息有误'); } $this->jpBrokerId = $jpBrokerId; break; case 'cancelHouseCombo': $jpBrokerId = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerId($this->brokerId)->id; if (!$jpBrokerId) { $this->outPut(0, '金铺经纪人信息有误'); } //是否套餐经纪人 $broker_info = Dao_Broker_BrokerInfo::get_broker_base_info($this->brokerId); if ($broker_info['PAYTYPE'] != 9999) { $this->outPut(0, '经纪人信息有误'); } if (empty($this->params['houseIds'])) { $this->outPut(0, '房源信息有误'); } $this->jpBrokerId = $jpBrokerId; break; case 'getPropTemplate': $jpBrokerId = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerId($this->brokerId)->id; if (!$jpBrokerId) { $this->outPut(0, '金铺经纪人信息有误'); } $this->jpBrokerId = $jpBrokerId; break; case 'savePropTemplate': $jpBrokerId = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerId($this->brokerId)->id; if (!$jpBrokerId) { $this->outPut(0, '金铺经纪人信息有误'); } if (!isset($this->params['type']) || !in_array($this->params['type'], array(1, 2, 3, 4))) { $this->outPut(0, '房源模板信息有误'); } if (!isset($this->params['title']) || empty($this->params['title']) || mb_strlen($this->params['title'], 'UTF-8') > 30) { $this->outPut(0, '房源模板标题不能超过30个字'); } if (!isset($this->params['content']) || empty($this->params['content'])) { $this->outPut(0, '房源模板内容不能为空'); } $templateContent = strip_tags($this->params['content']); if (empty($templateContent) || mb_strlen($templateContent, 'UTF-8') < 30) { $this->outPut(0, '房源模板内容不能小于30个字'); } $this->jpBrokerId = $jpBrokerId; break; case 'deletePropTemplate': $jpBrokerId = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerId($this->brokerId)->id; if (!$jpBrokerId) { $this->outPut(0, '金铺经纪人信息有误'); } $this->jpBrokerId = $jpBrokerId; break; } }
public static function get_old_manager($work_num) { $store = Dao_Broker_BrokerInfo::get_manager_info($work_num); return $store; }