|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
<?php
|
|
|
|
|
use Admin\FinancialSummarySetController;
|
|
|
|
|
namespace Admin\Controller;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -7,6 +8,20 @@ namespace Admin\Controller;
|
|
|
|
|
*/
|
|
|
|
|
class OldCountController extends \Think\Controller
|
|
|
|
|
{
|
|
|
|
|
//财务分类汇总统计旧数据聚合
|
|
|
|
|
public function FinancialSummaryInit()
|
|
|
|
|
{
|
|
|
|
|
//清空数据库
|
|
|
|
|
$sql = "truncate table tab_financial_summary";
|
|
|
|
|
$res = M()->execute($sql);
|
|
|
|
|
echo "tab_financial_summary 清空成功".PHP_EOL;
|
|
|
|
|
//获取19年9月到上个月的所有月份
|
|
|
|
|
$monthList = $this->getMonthsList();
|
|
|
|
|
$Financial = new FinancialSummarySetController();
|
|
|
|
|
foreach ($monthList as $k => $v) {
|
|
|
|
|
$Financial->setMonthFinancialSummary($v);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//超级签订单新增识别微信或者支付宝2019-12-11
|
|
|
|
|
public function gameSupersignPaywayInit()
|
|
|
|
|
{
|
|
|
|
@ -87,5 +102,25 @@ class OldCountController extends \Think\Controller
|
|
|
|
|
}
|
|
|
|
|
die("init ok");
|
|
|
|
|
}
|
|
|
|
|
//获取公司月结所需要的所有月份截止至上个月
|
|
|
|
|
public function getMonthsList()
|
|
|
|
|
{
|
|
|
|
|
$start_month = "2019-09";
|
|
|
|
|
|
|
|
|
|
$temp = strtotime(date('Y-m-01 00:00:00',strtotime('-1 month')));
|
|
|
|
|
$end_month = date('Y',$temp)."-".date('m',$temp);
|
|
|
|
|
|
|
|
|
|
$time_arr = [];
|
|
|
|
|
$begin = new \DateTime($start_month);
|
|
|
|
|
$end = new \DateTime($end_month);
|
|
|
|
|
$end = $end->modify('+1 month');
|
|
|
|
|
$interval = new \DateInterval('P1M');
|
|
|
|
|
$daterange = new \DatePeriod($begin, $interval ,$end);
|
|
|
|
|
foreach($daterange as $date){
|
|
|
|
|
$time_arr[] = $date->format("Y-m");
|
|
|
|
|
}
|
|
|
|
|
return $time_arr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|