|
@@ -22,31 +22,35 @@ class CronAction extends Action {
|
|
|
echo "LicensePlate empty!".PHP_EOL;
|
|
|
continue;
|
|
|
}
|
|
|
+ if(!$info['ExpireTime']){
|
|
|
+ echo "ExpireTime empty!".PHP_EOL;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- //检测车牌是否已生成待开户订单,已生成的丢弃,未生成释放到公选池
|
|
|
- $cond = array(
|
|
|
- 'LicensePlate' => $info['LicensePlate'],
|
|
|
- 'OrderStatus' => C('订单状态_待开户')
|
|
|
- );
|
|
|
- $order_info = M('jms_order')->where($cond)->field('LicensePlate,OrderStatus')->find();
|
|
|
- if(!$order_info){
|
|
|
+ //过期的预约车牌
|
|
|
+ if(time()>$info['ExpireTime']){
|
|
|
+ //检测车牌是否已生成待开户订单,已生成的丢弃,未生成释放到公选池
|
|
|
$cond = array(
|
|
|
'LicensePlate' => $info['LicensePlate'],
|
|
|
- 'OrderStatus' => C('订单状态_已开户')
|
|
|
+ 'OrderStatus' => C('订单状态_待开户')
|
|
|
);
|
|
|
$order_info = M('jms_order')->where($cond)->field('LicensePlate,OrderStatus')->find();
|
|
|
- }
|
|
|
- if($order_info && $order_info['OrderStatus'] === C('订单状态_待开户')){
|
|
|
- echo 'LicensePlate: '.$info['LicensePlate'].' has waiting order,discard!'.PHP_EOL;
|
|
|
- continue;
|
|
|
- }
|
|
|
- if($order_info && $order_info['OrderStatus'] === C('订单状态_已开户')){
|
|
|
- echo 'LicensePlate: '.$info['LicensePlate'].' has finish order,discard!'.PHP_EOL;
|
|
|
- continue;
|
|
|
- }
|
|
|
- //过期的预约车牌,释放到公选池
|
|
|
- if(time()>$info['ExpireTime']){
|
|
|
+ if(!$order_info){
|
|
|
+ $cond = array(
|
|
|
+ 'LicensePlate' => $info['LicensePlate'],
|
|
|
+ 'OrderStatus' => C('订单状态_已开户')
|
|
|
+ );
|
|
|
+ $order_info = M('jms_order')->where($cond)->field('LicensePlate,OrderStatus')->find();
|
|
|
+ }
|
|
|
+ if($order_info && $order_info['OrderStatus'] == C('订单状态_待开户')){
|
|
|
+ echo 'LicensePlate: '.$info['LicensePlate'].' has waiting order,discard!'.PHP_EOL;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if($order_info && $order_info['OrderStatus'] == C('订单状态_已开户')){
|
|
|
+ echo 'LicensePlate: '.$info['LicensePlate'].' has finish order,discard!'.PHP_EOL;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //过期的预约车牌,释放到公选池
|
|
|
$result = $plate_preselect_pool -> add($info['LicensePlate']);
|
|
|
if(!$result){
|
|
|
echo 'LicensePlate: '.$info['LicensePlate'].' push to plate_preselect_pool failed!'.PHP_EOL;
|