Commit 9926fa2b authored by liuqiao's avatar liuqiao

Merge branch 'master' into feature-lq-04

parents fad9b05c bf84ad7e
......@@ -846,7 +846,7 @@ if(!function_exists('sendsms'))
{
function sendsms($mobile,$msg){
global $conf_city;
curl_get_contents("http://mysms.house365.com:81/index.php/Interface/apiSendMobil/jid/7/depart/3/city/".$conf_city."/mobileno/".$mobile."/?msg=".urlencode($msg));
curl_get_contents("http://mysms.house365.com/index.php/Interface/apiSendMobil/jid/7/depart/3/city/".$conf_city."/mobileno/".$mobile."/?msg=".urlencode($msg));
}
}
......
......@@ -860,7 +860,7 @@ if(!function_exists('sendsms'))
{
function sendsms($mobile,$msg){
global $conf_city;
curl_get_contents("http://mysms.house365.com:81/index.php/Interface/apiSendMobil/jid/7/depart/3/city/".$conf_city."/mobileno/".$mobile."/?msg=".urlencode($msg));
curl_get_contents("http://mysms.house365.com/index.php/Interface/apiSendMobil/jid/7/depart/3/city/".$conf_city."/mobileno/".$mobile."/?msg=".urlencode($msg));
}
}
......
<?php
/**
* 竞投结束后的处理
* 1,on表数据移动到history表
* 2,对竞投成功的,扣除积分,且解冻相应积分
* 3, 加成长
* 4,对竞投成功的,刷成功表
* @param int $periodsId 期次id
* @param string $type house 或者 blockExpert
* ��Ͷ������Ĵ���
* 1��on�������ƶ���history��
* 2���Ծ�Ͷ�ɹ��ģ��۳����֣��ҽⶳ��Ӧ����
* 3, �ӳɳ�ֵ
* 4���Ծ�Ͷ�ɹ��ģ�ˢ�ɹ���
* @param int $periodsId �ڴ�id
* @param string $type house ���� blockExpert
*/
function bidFinishHandle($periodsId,$type) {
$growthRecordOn = GrowthBidRecordFactory::getRecordOnClass($type);
......@@ -37,19 +37,19 @@ function bidFinishHandle($periodsId,$type) {
}
$inserTemp[] = $temp;
if ($bidNum == $j) {
GrowthLog::log('始刷'.$growthRecordHistory->getTable(),'');
GrowthLog::log('��ʼˢ'.$growthRecordHistory->getTable(),'');
$affectedLineNumber = $growthRecordHistory->insertMutl($inserTemp);
GrowthLog::log('结束'.$growthRecordHistory->getTable().'共'.$affectedLineNumber.'条数据', $inserTemp);
GrowthLog::log('����'.$growthRecordHistory->getTable().'��'.$affectedLineNumber.'������', $inserTemp);
$inserTemp = array();
}
if($temp['status']==1) {//暂时保存成功的数据
if($temp['status']==1) {//��ʱ����ɹ�������
$bidSuccessData[] = $temp;
}
}
$runCount += $affectedLineNumber;
//更新前4名的status
//����ǰ4����status
/*
array_unique($bidIds);//去重复
array_unique($bidIds);//ȥ�ظ�
if($bidIds) {
foreach ($bidIds as $bid) {
$tableName = $growthRecordHistory->getTable();
......@@ -61,47 +61,47 @@ function bidFinishHandle($periodsId,$type) {
}
}
if ($recordOnCount == $runCount) {
GrowthLog::log('成功,期次为'.$pid.'的所有竞投记录已刷到history表',array('total'=>$recordOnCount,'runcount'=>$runCount));
sendMessage('成功,期次为'.$pid.'的所有竞投记录已刷到history表');
GrowthLog::log('�ɹ����ڴ�Ϊ'.$pid.'�����о�Ͷ��¼��ˢ��history��',array('total'=>$recordOnCount,'runcount'=>$runCount));
sendMessage('�ɹ����ڴ�Ϊ'.$pid.'�����о�Ͷ��¼��ˢ��history��');
handleBidSuccessData($bidSuccessData,$type,$pid);
echo 'success';
return true;
} else {
GrowthLog::log('失败,期次为'.$pid.'的竞投记录未全部刷到history表',array('number'=>$recordOnCount,'runcount'=>$runCount));
GrowthLog::log(�ܣ��ڴ�Ϊ'.$pid.'�ľ�Ͷ��¼δȫ��ˢ��history��',array('number'=>$recordOnCount,'runcount'=>$runCount));
echo 'failture';
return false;
}
}
/**
* 保存竞投成功记录;扣除积分,解冻积分;加成长
* @param type $bidSuccessData 竞投成功记
* @param type $type 竞投类型,小区专家或房源竞
* @param type $pid 竞投期次id
* ���澺Ͷ�ɹ���¼���۳����֣��ⶳ���֣��ӳɳ�ֵ
* @param type $bidSuccessData ��Ͷ�ɹ���¼
* @param type $type ��Ͷ���ͣ�С��ר�һ�Դ��Ͷ
* @param type $pid ��Ͷ�ڴ�id
* @return null
*/
function handleBidSuccessData($bidSuccessData,$type,$pid,$debug=0) {
//不是数组,或空数组
//�������飬�������
if(!is_array($bidSuccessData)||empty($bidSuccessData)) {
return null;
}
//查找期次的推广时间
//�����ڴε��ƹ�ʱ��
$growthBidPeriods = new GrowthBidPeriods();
//$cPeriods
$cPeriods = $growthBidPeriods->findById($pid);
$growthRecordFinish = GrowthBidRecordFactory::getRecordFinishClass($type);//new GrowthBidBlockExpertRecordHistory();
//print_r($recordOn);
$wayBlock = new WayBlock();
//房源竞投关键词
//��Դ��Ͷ�ؼ���
$growthBidHouse = new GrowthBidHouse();
$block = new Block();
GrowthLog::log('开始刷竞投成功表,期次为'.$pid.'',array());
GrowthLog::log('��ʼˢ��Ͷ�ɹ����ڴ�Ϊ'.$pid.'',array());
foreach ($bidSuccessData as $temp) {
if($type=='blockExpert') {//如果是小区专家竞投
/*****************扣积分*****************/
if($type=='blockExpert') {//�����С��ר�Ҿ�Ͷ
/*****************�ۻ���*****************/
$blockId = $temp['block_id'];
$creditWay = $wayBlock->getBlockExpertWayAlias($blockId);
//刷成功记录表
//ˢ�ɹ���¼��
$tempBlock = array(
'broker_id' => $temp['broker_id'],
'block_id' => $temp['block_id'],
......@@ -113,12 +113,12 @@ function handleBidSuccessData($bidSuccessData,$type,$pid,$debug=0) {
);
$insertId = $growthRecordFinish->insert($tempBlock);
if($insertId) {
GrowthLog::log('成功,刷小区竞投id为'.$temp['bid_id'].'成功记录',$tempBlock);
GrowthLog::log('�ɹ���ˢС����ͶidΪ'.$temp['bid_id'].'�ɹ���¼',$tempBlock);
} else {
GrowthLog::log('失败,刷小区竞投id为'.$temp['bid_id'].'成功记录',$tempBlock);
GrowthLog::log(�ܣ�ˢС����ͶidΪ'.$temp['bid_id'].'�ɹ���¼',$tempBlock);
}
}
if($type=='house') {//房源竞
if($type=='house') {//��Դ��Ͷ
$bidRow = $growthBidHouse->findById($temp['bid_id']);
if ($temp['type'] == 1) {
$blockInfo = $block->findOneBy($bidRow['block_id']);
......@@ -140,9 +140,9 @@ function handleBidSuccessData($bidSuccessData,$type,$pid,$debug=0) {
);
$insertId = $growthRecordFinish->insert($tempHouse);
if($insertId) {
GrowthLog::log('成功,刷房源竞投id为'.$temp['bid_id'].'成功记录',$tempHouse);
GrowthLog::log('�ɹ���ˢ��Դ��ͶidΪ'.$temp['bid_id'].'�ɹ���¼',$tempHouse);
} else {
GrowthLog::log('失败,刷房源竞投id为'.$temp['bid_id'].'成功记录',$tempHouse);
GrowthLog::log(�ܣ�ˢ��Դ��ͶidΪ'.$temp['bid_id'].'�ɹ���¼',$tempHouse);
}
}
if(!$debug) {
......@@ -152,56 +152,56 @@ function handleBidSuccessData($bidSuccessData,$type,$pid,$debug=0) {
$broker = array('id'=>$brokerId);
$brokerGroup = new BrokerGroup();
$brokerRow = $brokerGroup->getBrokerGroupInfo($brokerId);
if(!$brokerRow) {GrowthLog::log('经纪人'.$brokerId.'不存在'.$score,array());continue;}
if(!$brokerRow) {GrowthLog::log('������'.$brokerId.'������'.$score,array());continue;}
$broker['groupid'] = $brokerRow['groupid'];
$growthBrokerCredit = new GrowthBrokerCredit($broker);
$growthBrokerCredit->reduce($creditWay, $description, $score);
GrowthLog::log('扣除'.$brokerId.'的积分'.$score,array());
/*************扣完积分,解除冻结*****************/
GrowthLog::log('�۳�'.$brokerId.'�Ļ���'.$score,array());
/*************�������,�������*****************/
$growthBrokerCredit->frozenCredit("-".$score);
GrowthLog::log('解除冻结'.$brokerId.'的积分'.$score,array());
/*************加成长值************************/
GrowthLog::log('�������'.$brokerId.'����'.$score,array());
/*************�ӳɳ�ֵ************************/
$growthBrokerExp = new GrowthBrokerExp($broker);
$growthBrokerExp->increase($creditWay, $description);
GrowthLog::log('增加'.$brokerId.'的成长值'.$score,array());
GrowthLog::log('����'.$brokerId.'�ijɳ�ֵ'.$score,array());
}
}
sendMessage('结束刷竞投成功表,期次为'.$pid);
GrowthLog::log('结束刷竞投成功表,期次为'.$pid.'',array());
sendMessage('����ˢ��Ͷ�ɹ����ڴ�Ϊ'.$pid);
GrowthLog::log('����ˢ��Ͷ�ɹ����ڴ�Ϊ'.$pid.'',array());
}
/**
* 根据时间创建小区专家竞
* @param type $startTime 竞投开始时间Y-m-d H:i:s格式的字符串,下
* @param type $endTime 竞投结束时间
* @param type $tgStartTime 推广开始时间
* @param type $tgEndTime 推广结束时间
* ����ʱ�䴴��С��ר�Ҿ�Ͷ
* @param type $startTime ��Ͷ��ʼʱ��Y-m-d H:i:s��ʽ���ַ�������ͬ
* @param type $endTime ��Ͷ����ʱ��
* @param type $tgStartTime �ƹ㿪ʼʱ��
* @param type $tgEndTime �ƹ����ʱ��
*/
function createNextBidBlockExpert($startTime,$endTime,$tgStartTime,$tgEndTime) {
$growthBidPeriods = new GrowthBidPeriods();
$growthBid = new GrowthBidBlockExpert();
//竞投小区专家期次
//��ͶС��ר���ڴ�
$fieldData = array(
'type' => 1,
'name' => '小区专家竞投',
'name' => ��ר�Ҿ�Ͷ',
'start_time'=>$startTime,
'end_time'=>$endTime,
'tg_start_time'=>$tgStartTime,
'tg_end_time'=>$tgEndTime);
$bidPeriodsId = $growthBidPeriods->insert($fieldData);
if($bidPeriodsId) {
echo "创建小区专家竞投期次,id=".$bidPeriodsId."。"."时间:".$fieldData['tg_start_time']."到".$fieldData['tg_end_time'];
echo "����С��ר�Ҿ�Ͷ�ڴΣ�id=".$bidPeriodsId."��"."ʱ�䣺".$fieldData['tg_start_time']."��".$fieldData['tg_end_time'];
echo "<br/>";
} else {
echo "创建小区专家竞投期次,失败";
echo "����С��ר�Ҿ�Ͷ�ڴΣ�ʧ��";
}
//小区id和等级
//С��id�͵ȼ�
$blockLevelHeat = new BlockLevelHeat();
$blocks = $blockLevelHeat->findAll();
//起拍积分,参与等级
//���Ļ��֣�����ȼ�
$growthBidStartSetting = new GrowthBidStartSetting();
$data_info = $growthBidStartSetting->getData();
$data_info1 = array();
......@@ -222,47 +222,47 @@ function createNextBidBlockExpert($startTime,$endTime,$tgStartTime,$tgEndTime) {
$temp['ctime'] = date("Y-m-d H:i:s");
$inid = $growthBid->insert($temp);
if($inid) {
echo "创建小区竞投成功,id=".$inid."。小区id为".$value['id'];
echo "����С����Ͷ�ɹ���id=".$inid."��С��idΪ".$value['id'];
} else {
echo "失败,小区id为".$value['id'];
echo �ܣ�С��idΪ".$value['id'];
}
echo "<br/>";
}
}
sendMessage('创建小区竞投成功');
sendMessage('����С����Ͷ�ɹ�');
}
/**
* 根据时间创建房源竞
* @param type $startTime 竞投开始时间Y-m-d H:i:s格式的字符串,下
* @param type $endTime 竞投结束时间
* @param type $tgStartTime 推广开始时间
* @param type $tgEndTime 推广结束时间
* ����ʱ�䴴����Դ��Ͷ
* @param type $startTime ��Ͷ��ʼʱ��Y-m-d H:i:s��ʽ���ַ�������ͬ
* @param type $endTime ��Ͷ����ʱ��
* @param type $tgStartTime �ƹ㿪ʼʱ��
* @param type $tgEndTime �ƹ����ʱ��
*/
function createNextBidHouse($startTime,$endTime,$tgStartTime,$tgEndTime) {
$growthBidPeriods = new GrowthBidPeriods();
$growthBid = new GrowthBidHouse();
//竞投小区词期次
//��ͶС�����ڴ�
$fieldData = array(
'type' => 2,
'name' => '房源竞投',
'name' => '��Դ��Ͷ',
'start_time'=>$startTime,
'end_time'=>$endTime,
'tg_start_time'=>$tgStartTime,
'tg_end_time'=>$tgEndTime);
$bidPeriodsId = $growthBidPeriods->insert($fieldData);
if($bidPeriodsId) {
echo "创建小区词竞投期次,id=".$bidPeriodsId."。"."时间:".$fieldData['tg_start_time']."到".$fieldData['tg_end_time'];
echo "����С���ʾ�Ͷ�ڴΣ�id=".$bidPeriodsId."��"."ʱ�䣺".$fieldData['tg_start_time']."��".$fieldData['tg_end_time'];
echo "<br/>";
} else {
echo "创建小区词竞投期次,失败";
echo "����С���ʾ�Ͷ�ڴΣ�ʧ��";
}
//小区id和等级
//С��id�͵ȼ�
$blockLevelHeat = new BlockLevelHeat();
$blocks = $blockLevelHeat->findAll();
//起拍积分,参与等级
//���Ļ��֣�����ȼ�
$growthBidStartSetting = new GrowthBidStartSetting();
$data_info = $growthBidStartSetting->getData();
$data_info1 = array();
......@@ -283,15 +283,15 @@ function createNextBidHouse($startTime,$endTime,$tgStartTime,$tgEndTime) {
$temp['ctime'] = date("Y-m-d H:i:s");
$inid = $growthBid->insert($temp);
if($inid) {
echo "创建小区词竞投成功,id=".$inid."。小区id为".$value['id'];
echo "����С���ʾ�Ͷ�ɹ���id=".$inid."��С��idΪ".$value['id'];
} else {
echo "失败,小区id为".$value['id'];
echo �ܣ�С��idΪ".$value['id'];
}
echo "<br/>";
}
}
//热搜词
//���Ѵ�
$growBidHotSearchSet = new GrowthBidHotSearchSet();
$arrSearchWords = $growBidHotSearchSet->findWords();
if($arrSearchWords) {
......@@ -307,18 +307,18 @@ function createNextBidHouse($startTime,$endTime,$tgStartTime,$tgEndTime) {
$temp['ctime'] = date("Y-m-d H:i:s");
$inid = $growthBid->insert($temp);
if($inid) {
echo "创建热搜词竞投成功,id=".$inid."。热搜词为".$value['words'];
echo "�������Ѵʾ�Ͷ�ɹ���id=".$inid."�����Ѵ�Ϊ".$value['words'];
} else {
echo "失败,热搜词为".$value;
echo �ܣ����Ѵ�Ϊ".$value;
}
echo "<br/>";
}
}
sendMessage('创建房源竞投成功');
sendMessage('������Դ��Ͷ�ɹ�');
}
/**
* 更新竞投小区专家最低等级
* ���¾�ͶС��ר����͵ȼ�
*/
function updateBidBlockExpertLowLevel() {
$growthBidStartSetting = new GrowthBidStartSetting();
......@@ -327,7 +327,7 @@ function updateBidBlockExpertLowLevel() {
$minBidBlockLevel = '';
$bidBlockLevels = '';
foreach ($data_info as $key => $value) {
//subclass = 1 小区竞投 subclass 2 房源竞
//subclass = 1 С����Ͷ subclass 2 ��Դ��Ͷ
if ($value['subclass'] == 1) {
$bidBlockLevels .= str_replace('LV', '', $value['levelnames']) . ',';
}
......@@ -336,12 +336,12 @@ function updateBidBlockExpertLowLevel() {
$minBidBlockLevel = min(explode(',', $bidBlockLevels));
$bolUpdateBlock = $growthBidLowLevel->updateBlockExpertLevel('LV' . $minBidBlockLevel);
if ($bolUpdateBlock) {
echo '更新小区专家最低竞投等级成功';
echo '����С��ר����;�Ͷ�ȼ��ɹ�';
}
}
/**
* 更新竞投房源最低等级
* ���¾�Ͷ��Դ��͵ȼ�
*/
function updateBidHouseLowLevel() {
$growthBidStartSetting = new GrowthBidStartSetting();
......@@ -358,12 +358,12 @@ function updateBidHouseLowLevel() {
$minBidHouseLevel = min(explode(',', $bidHouseLevels));
$bolUpdateHouse = $growthBidLowLevel->updateHouseLevel('LV' . $minBidHouseLevel);
if ($bolUpdateHouse) {
echo '<br>更新房源最低竞投等级成功';
echo '<br>���·�Դ��;�Ͷ�ȼ��ɹ�';
}
}
/**
* 更新竞投房源中热搜词和小区词的相关等级
* ���¾�Ͷ��Դ�����Ѵʺ�С���ʵ���صȼ�
*/
function updateBidHouseLevel() {
$growthBidStartSetting = new GrowthBidStartSetting();
......@@ -383,15 +383,15 @@ function updateBidHouseLevel() {
$updateBlockStatus = $growthBidHouseLevel->updateBlockLevel($bidHouseBlockLevel);
$updateHotSearchStatus = $growthBidHouseLevel->updateHotSearchLevel($bidHouseHotSearchLevel);
if($growthBidHouseLevel && $updateHotSearchStatus) {
echo '竞投房源所需要的等级成功';
echo '��Ͷ��Դ����Ҫ�ĵȼ��ɹ�';
}
}
}
/**
* 返回几天后的日期
* @param type $date 日期,格式 Y-m-d H:i:s
* @param int $days 天数
* ���ؼ���������
* @param type $date ���ڣ���ʽ Y-m-d H:i:s
* @param int $days ����
* @return type
*/
function getNextBidDateFromBidDate($date,$days){
......@@ -399,7 +399,7 @@ function getNextBidDateFromBidDate($date,$days){
}
/**
* 保存执行过job的数据
* ����ִ�й�job������
* @global type $db_sys
* @global type $city
* @param type $jobname
......@@ -418,7 +418,7 @@ function insertJobData($jobname, $msg) {
}
/**
* 查找某个job是某已经执行成功
* ����ij��job��ij�Ѿ�ִ�гɹ�
* @global type $db_sys
* @global type $city
* @param type $jobname
......@@ -433,15 +433,15 @@ function getJobState($jobname) {
}
//发送短信
//���Ͷ���
function sendMessage($msg) {
$telno = array('13851894682', '18260082244');
foreach($telno as $v) {
curl_get_contents("http://mysms.house365.com:81/index.php/Interface/apiSendMobil/jid/7/depart/3/city/nj/mobileno/".$v."/msg/".urlencode($msg));
curl_get_contents("http://mysms.house365.com/index.php/Interface/apiSendMobil/jid/7/depart/3/city/nj/mobileno/".$v."/msg/".urlencode($msg));
}
}
//http curl请求
//http curl����
if(!function_exists('curl_get_contents'))
{
function curl_get_contents($str,$t_url="")
......
<?php
/**
* 竞投结束后的处理
* 1,on表数据移动到history表
* 2,对竞投成功的,扣除积分,且解冻相应积分
* 3, 加成长
* 4,对竞投成功的,刷成功表
* @param int $periodsId 期次id
* @param string $type house 或者 blockExpert
* ��Ͷ������Ĵ���
* 1��on�������ƶ���history��
* 2���Ծ�Ͷ�ɹ��ģ��۳����֣��ҽⶳ��Ӧ����
* 3, �ӳɳ�ֵ
* 4���Ծ�Ͷ�ɹ��ģ�ˢ�ɹ���
* @param int $periodsId �ڴ�id
* @param string $type house ���� blockExpert
*/
function bidFinishHandle($periodsId,$type) {
$growthRecordOn = GrowthBidRecordFactory::getRecordOnClass($type);
......@@ -37,19 +37,19 @@ function bidFinishHandle($periodsId,$type) {
}
$inserTemp[] = $temp;
if ($bidNum == $j) {
GrowthLog::log('始刷'.$growthRecordHistory->getTable(),'');
GrowthLog::log('��ʼˢ'.$growthRecordHistory->getTable(),'');
$affectedLineNumber = $growthRecordHistory->insertMutl($inserTemp);
GrowthLog::log('结束'.$growthRecordHistory->getTable().'共'.$affectedLineNumber.'条数据', $inserTemp);
GrowthLog::log('����'.$growthRecordHistory->getTable().'��'.$affectedLineNumber.'������', $inserTemp);
$inserTemp = array();
}
if($temp['status']==1) {//暂时保存成功的数据
if($temp['status']==1) {//��ʱ����ɹ�������
$bidSuccessData[] = $temp;
}
}
$runCount += $affectedLineNumber;
//更新前4名的status
//����ǰ4����status
/*
array_unique($bidIds);//去重复
array_unique($bidIds);//ȥ�ظ�
if($bidIds) {
foreach ($bidIds as $bid) {
$tableName = $growthRecordHistory->getTable();
......@@ -61,48 +61,48 @@ function bidFinishHandle($periodsId,$type) {
}
}
if ($recordOnCount == $runCount) {
GrowthLog::log('成功,期次为'.$pid.'的所有竞投记录已刷到history表',array('total'=>$recordOnCount,'runcount'=>$runCount));
sendMessage('成功,期次为'.$pid.'的所有竞投记录已刷到history表');
GrowthLog::log('�ɹ����ڴ�Ϊ'.$pid.'�����о�Ͷ��¼��ˢ��history��',array('total'=>$recordOnCount,'runcount'=>$runCount));
sendMessage('�ɹ����ڴ�Ϊ'.$pid.'�����о�Ͷ��¼��ˢ��history��');
handleBidSuccessData($bidSuccessData,$type,$pid);
echo 'success';
return true;
} else {
GrowthLog::log('失败,期次为'.$pid.'的竞投记录未全部刷到history表',array('number'=>$recordOnCount,'runcount'=>$runCount));
GrowthLog::log(�ܣ��ڴ�Ϊ'.$pid.'�ľ�Ͷ��¼δȫ��ˢ��history��',array('number'=>$recordOnCount,'runcount'=>$runCount));
echo 'failture';
return false;
}
}
/**
* 保存竞投成功记录;扣除积分,解冻积分;加成长
* @param type $bidSuccessData 竞投成功记
* @param type $type 竞投类型,小区专家或房源竞
* @param type $pid 竞投期次id
* ���澺Ͷ�ɹ���¼���۳����֣��ⶳ���֣��ӳɳ�ֵ
* @param type $bidSuccessData ��Ͷ�ɹ���¼
* @param type $type ��Ͷ���ͣ�С��ר�һ�Դ��Ͷ
* @param type $pid ��Ͷ�ڴ�id
* @return null
*/
function handleBidSuccessData($bidSuccessData,$type,$pid,$debug=0) {
//不是数组,或空数组
//�������飬�������
global $conf_cityflag;
if(!is_array($bidSuccessData)||empty($bidSuccessData)) {
return null;
}
//查找期次的推广时间
//�����ڴε��ƹ�ʱ��
$growthBidPeriods = new GrowthBidPeriods();
//$cPeriods
$cPeriods = $growthBidPeriods->findById($pid);
$growthRecordFinish = GrowthBidRecordFactory::getRecordFinishClass($type);//new GrowthBidBlockExpertRecordHistory();
//print_r($recordOn);
$wayBlock = new WayBlock();
//房源竞投关键词
//��Դ��Ͷ�ؼ���
$growthBidHouse = new GrowthBidHouse();
$block = new Block();
GrowthLog::log('开始刷竞投成功表,期次为'.$pid.'',array());
GrowthLog::log('��ʼˢ��Ͷ�ɹ����ڴ�Ϊ'.$pid.'',array());
foreach ($bidSuccessData as $temp) {
if($type=='blockExpert') {//如果是小区专家竞投
/*****************扣积分*****************/
if($type=='blockExpert') {//�����С��ר�Ҿ�Ͷ
/*****************�ۻ���*****************/
$blockId = $temp['block_id'];
$creditWay = $wayBlock->getBlockExpertWayAlias($blockId);
//刷成功记录表
//ˢ�ɹ���¼��
$tempBlock = array(
'broker_id' => $temp['broker_id'],
'block_id' => $temp['block_id'],
......@@ -114,12 +114,12 @@ function handleBidSuccessData($bidSuccessData,$type,$pid,$debug=0) {
);
$insertId = $growthRecordFinish->insert($tempBlock);
if($insertId) {
GrowthLog::log('成功,刷小区竞投id为'.$temp['bid_id'].'成功记录',$tempBlock);
GrowthLog::log('�ɹ���ˢС����ͶidΪ'.$temp['bid_id'].'�ɹ���¼',$tempBlock);
} else {
GrowthLog::log('失败,刷小区竞投id为'.$temp['bid_id'].'成功记录',$tempBlock);
GrowthLog::log(�ܣ�ˢС����ͶidΪ'.$temp['bid_id'].'�ɹ���¼',$tempBlock);
}
}
if($type=='house') {//房源竞
if($type=='house') {//��Դ��Ͷ
$bidRow = $growthBidHouse->findById($temp['bid_id']);
if ($temp['type'] == 1) {
$blockInfo = $block->findOneBy($bidRow['block_id']);
......@@ -141,9 +141,9 @@ function handleBidSuccessData($bidSuccessData,$type,$pid,$debug=0) {
);
$insertId = $growthRecordFinish->insert($tempHouse);
if($insertId) {
GrowthLog::log('成功,刷房源竞投id为'.$temp['bid_id'].'成功记录',$tempHouse);
GrowthLog::log('�ɹ���ˢ��Դ��ͶidΪ'.$temp['bid_id'].'�ɹ���¼',$tempHouse);
} else {
GrowthLog::log('失败,刷房源竞投id为'.$temp['bid_id'].'成功记录',$tempHouse);
GrowthLog::log(�ܣ�ˢ��Դ��ͶidΪ'.$temp['bid_id'].'�ɹ���¼',$tempHouse);
}
}
if(!$debug) {
......@@ -153,66 +153,66 @@ function handleBidSuccessData($bidSuccessData,$type,$pid,$debug=0) {
$broker = array('id'=>$brokerId);
$brokerGroup = new BrokerGroup();
$brokerRow = $brokerGroup->getBrokerGroupInfo($brokerId);
if(!$brokerRow) {GrowthLog::log('经纪人'.$brokerId.'不存在'.$score,array());continue;}
if(!$brokerRow) {GrowthLog::log('������'.$brokerId.'������'.$score,array());continue;}
$broker['groupid'] = $brokerRow['package_id'];
$growthBrokerCredit = new GrowthBrokerCredit($broker);
if($conf_cityflag=='nj') {
$type2=2;$creditName="房豆";$creditUnit="房豆";
$type2=2;$creditName="����";$creditUnit="����";
$descriptionC = $growthBrokerCredit->getWayAliasName($creditWay);
$descriptionC = $descriptionC . '扣除' . abs($score) . $creditUnit;
$descriptionC = $descriptionC . '�۳�' . abs($score) . $creditUnit;
}else {
$type2=1;$creditName="积分";$creditUnit="分";
$type2=1;$creditName="����";$creditUnit="��";
$descriptionC = null;
}
$growthBrokerCredit->reduce($creditWay, $descriptionC, $score,$type2);
GrowthLog::log('扣除'.$brokerId.'的'.$creditName.$score,array());
/*************扣完积分,解除冻结*****************/
$growthBrokerCredit->frozenCredit("-".$score,$brokerId,$alisWay='bidFinish','竞投结束,解除冻结'.$score,$type);
GrowthLog::log('解除冻结'.$brokerId.'的'.$creditName.$score,array());
/*************加成长值************************/
GrowthLog::log('�۳�'.$brokerId.'��'.$creditName.$score,array());
/*************�������,�������*****************/
$growthBrokerCredit->frozenCredit("-".$score,$brokerId,$alisWay='bidFinish','��Ͷ�������������'.$score,$type);
GrowthLog::log('�������'.$brokerId.'��'.$creditName.$score,array());
/*************�ӳɳ�ֵ************************/
$growthBrokerExp = new GrowthBrokerExp($broker);
$growthBrokerExp->increase($creditWay, $description);
GrowthLog::log('增加'.$brokerId.'的成长值'.$score,array());
GrowthLog::log('����'.$brokerId.'�ijɳ�ֵ'.$score,array());
}
}
sendMessage('结束刷竞投成功表,期次为'.$pid);
GrowthLog::log('结束刷竞投成功表,期次为'.$pid.'',array());
sendMessage('����ˢ��Ͷ�ɹ����ڴ�Ϊ'.$pid);
GrowthLog::log('����ˢ��Ͷ�ɹ����ڴ�Ϊ'.$pid.'',array());
}
/**
* 根据时间创建小区专家竞
* @param type $startTime 竞投开始时间Y-m-d H:i:s格式的字符串,下
* @param type $endTime 竞投结束时间
* @param type $tgStartTime 推广开始时间
* @param type $tgEndTime 推广结束时间
* ����ʱ�䴴��С��ר�Ҿ�Ͷ
* @param type $startTime ��Ͷ��ʼʱ��Y-m-d H:i:s��ʽ���ַ�������ͬ
* @param type $endTime ��Ͷ����ʱ��
* @param type $tgStartTime �ƹ㿪ʼʱ��
* @param type $tgEndTime �ƹ����ʱ��
*/
function createNextBidBlockExpert($startTime,$endTime,$tgStartTime,$tgEndTime) {
$growthBidPeriods = new GrowthBidPeriods();
$growthBid = new GrowthBidBlockExpert();
//竞投小区专家期次
//��ͶС��ר���ڴ�
$fieldData = array(
'type' => 1,
'name' => '小区专家竞投',
'name' => ��ר�Ҿ�Ͷ',
'start_time'=>$startTime,
'end_time'=>$endTime,
'tg_start_time'=>$tgStartTime,
'tg_end_time'=>$tgEndTime);
$bidPeriodsId = $growthBidPeriods->insert($fieldData);
if($bidPeriodsId) {
echo "创建小区专家竞投期次,id=".$bidPeriodsId."。"."时间:".$fieldData['tg_start_time']."到".$fieldData['tg_end_time'];
echo "����С��ר�Ҿ�Ͷ�ڴΣ�id=".$bidPeriodsId."��"."ʱ�䣺".$fieldData['tg_start_time']."��".$fieldData['tg_end_time'];
echo "<br/>";
} else {
echo "创建小区专家竞投期次,失败";
echo "����С��ר�Ҿ�Ͷ�ڴΣ�ʧ��";
}
//小区id和等级
//С��id�͵ȼ�
$blockLevelHeat = new BlockLevelHeat();
$blocks = $blockLevelHeat->findAll();
//起拍积分,参与等级
//���Ļ��֣�����ȼ�
$growthBidStartSetting = new GrowthBidStartSetting();
$data_info = $growthBidStartSetting->getData();
$data_info1 = array();
......@@ -245,49 +245,49 @@ function createNextBidBlockExpert($startTime,$endTime,$tgStartTime,$tgEndTime) {
$temp['ctime'] = date("Y-m-d H:i:s");
$inid = $growthBid->insert($temp);
if($inid) {
echo "创建小区竞投成功,id=".$inid."。小区id为".$value['id'];
echo "����С����Ͷ�ɹ���id=".$inid."��С��idΪ".$value['id'];
} else {
echo "失败,小区id为".$value['id'];
echo �ܣ�С��idΪ".$value['id'];
}
echo "<br/>";
}
}
sendMessage('创建小区竞投成功');
//刷指定的小区专家
sendMessage('����С����Ͷ�ɹ�');
//ˢָ����С��ר��
refreshSpecBlockExpert($fieldData);
}
/**
* 根据时间创建房源竞
* @param type $startTime 竞投开始时间Y-m-d H:i:s格式的字符串,下
* @param type $endTime 竞投结束时间
* @param type $tgStartTime 推广开始时间
* @param type $tgEndTime 推广结束时间
* ����ʱ�䴴����Դ��Ͷ
* @param type $startTime ��Ͷ��ʼʱ��Y-m-d H:i:s��ʽ���ַ�������ͬ
* @param type $endTime ��Ͷ����ʱ��
* @param type $tgStartTime �ƹ㿪ʼʱ��
* @param type $tgEndTime �ƹ����ʱ��
*/
function createNextBidHouse($startTime,$endTime,$tgStartTime,$tgEndTime) {
$growthBidPeriods = new GrowthBidPeriods();
$growthBid = new GrowthBidHouse();
//竞投小区词期次
//��ͶС�����ڴ�
$fieldData = array(
'type' => 2,
'name' => '房源竞投',
'name' => '��Դ��Ͷ',
'start_time'=>$startTime,
'end_time'=>$endTime,
'tg_start_time'=>$tgStartTime,
'tg_end_time'=>$tgEndTime);
$bidPeriodsId = $growthBidPeriods->insert($fieldData);
if($bidPeriodsId) {
echo "创建小区词竞投期次,id=".$bidPeriodsId."。"."时间:".$fieldData['tg_start_time']."到".$fieldData['tg_end_time'];
echo "����С���ʾ�Ͷ�ڴΣ�id=".$bidPeriodsId."��"."ʱ�䣺".$fieldData['tg_start_time']."��".$fieldData['tg_end_time'];
echo "<br/>";
} else {
echo "创建小区词竞投期次,失败";
echo "����С���ʾ�Ͷ�ڴΣ�ʧ��";
}
//小区id和等级
//С��id�͵ȼ�
$blockLevelHeat = new BlockLevelHeat();
$blocks = $blockLevelHeat->findAll();
//起拍积分,参与等级
//���Ļ��֣�����ȼ�
$growthBidStartSetting = new GrowthBidStartSetting();
$data_info = $growthBidStartSetting->getData();
$data_info1 = array();
......@@ -308,15 +308,15 @@ function createNextBidHouse($startTime,$endTime,$tgStartTime,$tgEndTime) {
$temp['ctime'] = date("Y-m-d H:i:s");
$inid = $growthBid->insert($temp);
if($inid) {
echo "创建小区词竞投成功,id=".$inid."。小区id为".$value['id'];
echo "����С���ʾ�Ͷ�ɹ���id=".$inid."��С��idΪ".$value['id'];
} else {
echo "失败,小区id为".$value['id'];
echo �ܣ�С��idΪ".$value['id'];
}
echo "<br/>";
}
}
//热搜词
//���Ѵ�
$growBidHotSearchSet = new GrowthBidHotSearchSet();
$arrSearchWords = $growBidHotSearchSet->findWords();
if($arrSearchWords) {
......@@ -332,18 +332,18 @@ function createNextBidHouse($startTime,$endTime,$tgStartTime,$tgEndTime) {
$temp['ctime'] = date("Y-m-d H:i:s");
$inid = $growthBid->insert($temp);
if($inid) {
echo "创建热搜词竞投成功,id=".$inid."。热搜词为".$value['words'];
echo "�������Ѵʾ�Ͷ�ɹ���id=".$inid."�����Ѵ�Ϊ".$value['words'];
} else {
echo "失败,热搜词为".$value;
echo �ܣ����Ѵ�Ϊ".$value;
}
echo "<br/>";
}
}
sendMessage('创建房源竞投成功');
sendMessage('������Դ��Ͷ�ɹ�');
}
/**
* 更新竞投小区专家最低等级
* ���¾�ͶС��ר����͵ȼ�
*/
function updateBidBlockExpertLowLevel() {
$growthBidStartSetting = new GrowthBidStartSetting();
......@@ -352,7 +352,7 @@ function updateBidBlockExpertLowLevel() {
$minBidBlockLevel = '';
$bidBlockLevels = '';
foreach ($data_info as $key => $value) {
//subclass = 1 小区竞投 subclass 2 房源竞
//subclass = 1 С����Ͷ subclass 2 ��Դ��Ͷ
if ($value['subclass'] == 1) {
$bidBlockLevels .= str_replace('LV', '', $value['levelnames']) . ',';
}
......@@ -361,12 +361,12 @@ function updateBidBlockExpertLowLevel() {
$minBidBlockLevel = min(explode(',', $bidBlockLevels));
$bolUpdateBlock = $growthBidLowLevel->updateBlockExpertLevel('LV' . $minBidBlockLevel);
if ($bolUpdateBlock) {
echo '更新小区专家最低竞投等级成功';
echo '����С��ר����;�Ͷ�ȼ��ɹ�';
}
}
/**
* 更新竞投房源最低等级
* ���¾�Ͷ��Դ��͵ȼ�
*/
function updateBidHouseLowLevel() {
$growthBidStartSetting = new GrowthBidStartSetting();
......@@ -383,12 +383,12 @@ function updateBidHouseLowLevel() {
$minBidHouseLevel = min(explode(',', $bidHouseLevels));
$bolUpdateHouse = $growthBidLowLevel->updateHouseLevel('LV' . $minBidHouseLevel);
if ($bolUpdateHouse) {
echo '<br>更新房源最低竞投等级成功';
echo '<br>���·�Դ��;�Ͷ�ȼ��ɹ�';
}
}
/**
* 更新竞投房源中热搜词和小区词的相关等级
* ���¾�Ͷ��Դ�����Ѵʺ�С���ʵ���صȼ�
*/
function updateBidHouseLevel() {
$growthBidStartSetting = new GrowthBidStartSetting();
......@@ -408,15 +408,15 @@ function updateBidHouseLevel() {
$updateBlockStatus = $growthBidHouseLevel->updateBlockLevel($bidHouseBlockLevel);
$updateHotSearchStatus = $growthBidHouseLevel->updateHotSearchLevel($bidHouseHotSearchLevel);
if($growthBidHouseLevel && $updateHotSearchStatus) {
echo '竞投房源所需要的等级成功';
echo '��Ͷ��Դ����Ҫ�ĵȼ��ɹ�';
}
}
}
/**
* 返回几天后的日期
* @param type $date 日期,格式 Y-m-d H:i:s
* @param int $days 天数
* ���ؼ���������
* @param type $date ���ڣ���ʽ Y-m-d H:i:s
* @param int $days ����
* @return type
*/
function getNextBidDateFromBidDate($date,$days){
......@@ -424,7 +424,7 @@ function getNextBidDateFromBidDate($date,$days){
}
/**
* 保存执行过job的数据
* ����ִ�й�job������
* @global type $db_sys
* @global type $city
* @param type $jobname
......@@ -443,7 +443,7 @@ function insertJobData($jobname, $msg) {
}
/**
* 查找某个job是某已经执行成功
* ����ij��job��ij�Ѿ�ִ�гɹ�
* @global type $db_sys
* @global type $city
* @param type $jobname
......@@ -457,16 +457,16 @@ function getJobState($jobname) {
}
//发送短信
//���Ͷ���
function sendMessage($msg) {
$telno = array('13851894682', '18260082244');
$telno = array();
foreach($telno as $v) {
curl_get_contents("http://mysms.house365.com:81/index.php/Interface/apiSendMobil/jid/7/depart/3/city/nj/mobileno/".$v."/msg/".urlencode($msg));
curl_get_contents("http://mysms.house365.com/index.php/Interface/apiSendMobil/jid/7/depart/3/city/nj/mobileno/".$v."/msg/".urlencode($msg));
}
}
//http curl请求
//http curl����
if(!function_exists('curl_get_contents'))
{
function curl_get_contents($str,$t_url="")
......@@ -483,7 +483,7 @@ if(!function_exists('curl_get_contents'))
}
}
//自定义
//�Զ���
function getCustomBlockBidNumber() {
global $dbback;
$time = time();
......@@ -494,7 +494,7 @@ function getCustomBlockBidNumber() {
}
/**
* 刷指定的小区专家
* ˢָ����С��ר��
*/
function refreshSpecBlockExpert($cPeriods) {
global $dbback;
......@@ -508,8 +508,8 @@ function refreshSpecBlockExpert($cPeriods) {
'broker_id' => $temp['uid'],
'block_id' => $temp['blockid'],
'block_name' => $temp['blockname'],
'score' => -1,//表示是指定的,不是通过竞投的
//'utime' => $temp['utime'],//使用默认值,创建竞投时
'score' => -1,//��ʾ��ָ���ģ�����ͨ����Ͷ��
//'utime' => $temp['utime'],//ʹ��Ĭ��ֵ��������Ͷʱ
'tg_start_time' => $cPeriods['tg_start_time'],
'tg_end_time' => $cPeriods['tg_end_time'],
);
......@@ -517,9 +517,9 @@ function refreshSpecBlockExpert($cPeriods) {
//continue;
$insertId = $growthRecordFinish->insert($tempBlock);
if($insertId) {
GrowthLog::log('指定'.$temp['broker_id'].'为小区专家',$tempBlock);
GrowthLog::log(��'.$temp['broker_id'].'ΪС��ר��',$tempBlock);
} else {
GrowthLog::log('未能指定'.$temp['broker_id'].'为小区专家',$tempBlock);
GrowthLog::log(��ָ��'.$temp['broker_id'].'ΪС��ר��',$tempBlock);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment