|
|
|
@ -12,6 +12,9 @@ $target_folder = null;
|
|
|
|
|
$targer_day = null;
|
|
|
|
|
// 获取前一天的对账单
|
|
|
|
|
$target_folder = str_replace("-", "/", date("Y-m", strtotime("-1 day")) ); // 2018/07
|
|
|
|
|
$targer_date = explode('/', $target_folder);
|
|
|
|
|
$target_year = $targer_date[0];
|
|
|
|
|
$target_month = $targer_date[1];
|
|
|
|
|
if (isset($_GET['f'])) {
|
|
|
|
|
$target_folder = $_GET['f']; // f=2018/06 f=2018/07/23
|
|
|
|
|
$target_set = explode('/', $target_folder);
|
|
|
|
@ -22,10 +25,17 @@ if (isset($_GET['f'])) {
|
|
|
|
|
}
|
|
|
|
|
$file_list = array_values(array_diff($sftp->nlist($target_folder), array(".","..")));
|
|
|
|
|
if ($targer_day !== null) {
|
|
|
|
|
$file_list = array($target_set[0] . $target_set[1] . $target_set[2] . ".xlsx");
|
|
|
|
|
$day_file_name = $target_set[0] . $target_set[1] . $target_set[2];
|
|
|
|
|
$target_file_list = array_map(function ($ele) use ($day_file_name)
|
|
|
|
|
{
|
|
|
|
|
return stripos($ele, $day_file_name)===false ? null : $ele;
|
|
|
|
|
}, $file_list);
|
|
|
|
|
$file_list = array_values(array_filter($target_file_list));
|
|
|
|
|
// $file_list = array($target_set[0] . $target_set[1] . $target_set[2] . ".xlsx");
|
|
|
|
|
}
|
|
|
|
|
// target local
|
|
|
|
|
$target_local = "statement_files/" . $target_folder;
|
|
|
|
|
$target_local = "settlement_files/ipaylinks-" . $target_folder;
|
|
|
|
|
// $target_local = "statement_files/ipaylinks-" . $target_folder;
|
|
|
|
|
if ( ! is_dir($target_local)) {
|
|
|
|
|
mkdir($target_local, 0777, true);
|
|
|
|
|
}
|
|
|
|
@ -47,5 +57,7 @@ echo "<br> new_files ", json_encode($new_files);
|
|
|
|
|
echo "<br> file_list ", json_encode($file_list);
|
|
|
|
|
|
|
|
|
|
// header("Location: http://www.mycht.cn/webht.php/apps/pay/ipaylinksservice/auto_update_statement?f=$target_folder&fjson=" . json_encode($new_files));
|
|
|
|
|
header("Location: http://www.mycht.cn/webht.php/apps/pay/report/ipaylinks_excel?f=$target_folder&fjson=" . json_encode($new_files));
|
|
|
|
|
// header("Location: http://www.mycht.cn/webht.php/apps/pay/report/ipaylinks_excel?f=$target_folder&fjson=" . json_encode($new_files));
|
|
|
|
|
$yestoday = date("Y/m/d", strtotime("-1 day"));
|
|
|
|
|
header("Location: http://www.mycht.cn/webht.php/apps/pay/paymentservice/ipalinks_settlement/$yestoday");
|
|
|
|
|
// header("Location: http://202.103.68.79:8083/webht.php/apps/pay/report/ipaylinks_excel?f=$target_folder&fjson=" . json_encode($new_files));
|
|
|
|
|