if($v['opCode'] == '50'){
$res = PickupRestful::postRestful("App.Mo.Upaorder",array('status'=>2,'orderno'=>$v['orderid']));
//做到只发送一次
$a = rand(1,3);
sleep($a);
$selredis = yii::$app->redis->get('morecovery_'.$v['orderid']);
if ($selredis) {
yii::pushlog(date('YmdHis').'发送自定义email11:'.$v['orderid']);
return false;
}else{
$orderinfo = PickupRestful::postRestful("App.Mo.OrderOne",array('ordernum' => $v['orderid']));
$orderdata = isset($orderinfo['data']) ? $orderinfo['data'] : '';
//导出自定义Excel
$excel = $this->OrderSucessExcel($orderdata);
//给收件方DB仓库一个:SCM供应链三个:推送4封邮件
$this->subemail($orderdata['OrderNO']);
yii::pushlog(date('YmdHis').'发送自定义email22:'.$v['orderid']);
yii::$app->redis->setex('morecovery_'.$v['orderid'],35,'redis');
}
}else if($v['opCode'] == '80'){
$res = PickupRestful::postRestful("App.Mo.Upaorder",array('status'=>3,'orderno'=>$v['orderid']));
}else if($v['opCode'] == '70'){
$res = PickupRestful::postRestful("App.Mo.Upaorder",array('status'=>4,'orderno'=>$v['orderid']));
}
}
|