Commit 5b608a98 authored by wwccw0591's avatar wwccw0591

pushupdate

parent c7f3df64
......@@ -57,6 +57,19 @@ class Common
return isset($httpStatusCodes[$num]) ? $httpStatusCodes[$num] : '';
}
public static function isCurentTimeInSection($begin,$end)
{
$checkDayStr = date('Y-m-d ',time());
$timeBegin1 = strtotime($checkDayStr.$begin.":00");
$timeEnd1 = strtotime($checkDayStr.$end.":00");
$curr_time = time();
if($curr_time >= $timeBegin1 && $curr_time <= $timeEnd1)
{
return true;
}
return false;
}
public static function isSerialized( $data ) {
$data = trim( $data );
if ( 'N;' == $data )
......
......@@ -48,10 +48,26 @@ class cliOrderClose extends basecli
$redis->auth($conf['password']);
}
$clientPush=\JPush\ClientPush::getInstance();
$memberCenterServiceDao=\Business\User\MemberCenterServiceModel::getInstance();
//$messageService=\DAO\MessageHistoryModel::getInstance();
while($pushData=$redis->rPop('push_center')){
$addData = unserialize($pushData);
$addData['message'] = unserialize($addData['message']);
$res=$memberCenterServiceDao->getMessageSet($addData['toId']);
echo json_encode($res);exit;
if($res['canPush']==\Our\ApiConst::one){
if(!empty($res['timeDiff'])){
$timeArr=explode('-',$res['timeDiff']);
if(!empty($timeArr)){
if(\Our\Common::isCurentTimeInSection($timeArr[0],$timeArr[1])){
continue;
}
}
}
}else{
continue;
}
$clientPush->push($addData);
}
$redis->close();
......
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