|
@@ -235,13 +235,18 @@ class handler
|
|
->limit("0,1000")
|
|
->limit("0,1000")
|
|
->select();
|
|
->select();
|
|
|
|
|
|
- if(empty($items)) break;
|
|
|
|
-
|
|
|
|
- $last_item = end($items);
|
|
|
|
- $order_id = intval($last_item['order_id']);
|
|
|
|
- Log::record("handler order_id={$order_id}",Log::DEBUG);
|
|
|
|
- yield [$items,$total_stage,$cur_stage];
|
|
|
|
|
|
+ if(empty($items)) {
|
|
|
|
+ yield [$items,$total_stage,$cur_stage];
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ $last_item = end($items);
|
|
|
|
+ $order_id = intval($last_item['order_id']);
|
|
|
|
+ Log::record("handler order_id={$order_id}",Log::DEBUG);
|
|
|
|
+ yield [$items,$total_stage,$cur_stage];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
$cur_stage++;
|
|
$cur_stage++;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -347,15 +352,15 @@ class handler
|
|
if (!is_dir($path)) {
|
|
if (!is_dir($path)) {
|
|
mkdir($path, 0755);
|
|
mkdir($path, 0755);
|
|
}
|
|
}
|
|
- $filename = date('YmdHis', time()) . "-订单导出.xlsx";
|
|
|
|
|
|
+ $filename = date('YmdHis', time()) . "订单导出.xlsx";
|
|
|
|
|
|
- $file_path = $path . $filename;
|
|
|
|
|
|
+ $file_path = "{$path}{$filename}";
|
|
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
|
|
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
|
|
$objWriter->save($file_path);
|
|
$objWriter->save($file_path);
|
|
|
|
|
|
return [true, $filename];
|
|
return [true, $filename];
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
- Log::record($e->getMessage(),Log::ERR);
|
|
|
|
|
|
+ Log::record("handler {$e->getMessage()}",Log::ERR);
|
|
return [false, false];
|
|
return [false, false];
|
|
}
|
|
}
|
|
}
|
|
}
|