|
|
|
@ -17,6 +17,7 @@ class FinancialSummarySetController extends \Think\Controller
|
|
|
|
|
//数据库
|
|
|
|
|
public $FinancialSummaryModel;
|
|
|
|
|
public function _initialize(){
|
|
|
|
|
|
|
|
|
|
//初始化
|
|
|
|
|
$this->beginThismonth = mktime(0,0,0,date('m')-1,1,date('Y'));
|
|
|
|
|
$this->endThismonth = mktime(0,0,0,date('m'),1,date('Y'))-1;
|
|
|
|
@ -25,7 +26,7 @@ class FinancialSummarySetController extends \Think\Controller
|
|
|
|
|
$this->month= date('m',$temp);
|
|
|
|
|
$this->date = $this->year."-".$this->month;
|
|
|
|
|
$this->nowdata =time();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->FinancialSummaryModel =M("FinancialSummary",'tab_');
|
|
|
|
|
$this->DepositModel =M("Deposit",'tab_');
|
|
|
|
|
$this->SpendModel = M("Spend",'tab_');
|
|
|
|
@ -37,11 +38,12 @@ class FinancialSummarySetController extends \Think\Controller
|
|
|
|
|
/**
|
|
|
|
|
* 更新某月数据
|
|
|
|
|
*/
|
|
|
|
|
public function setMonthFinancialSummary()
|
|
|
|
|
public function setMonthFinancialSummary($count_date)
|
|
|
|
|
{
|
|
|
|
|
$month = I("count_date");
|
|
|
|
|
$month = $count_date;
|
|
|
|
|
if(empty($month)) die("参数错误");
|
|
|
|
|
|
|
|
|
|
$this->adddata = [];//置空否者会脚本进来会重复计算
|
|
|
|
|
$this->date = $month;
|
|
|
|
|
$tarry = explode('-',$month);
|
|
|
|
|
$this->year= $tarry[0];
|
|
|
|
@ -94,7 +96,7 @@ class FinancialSummarySetController extends \Think\Controller
|
|
|
|
|
$this->addDb();
|
|
|
|
|
|
|
|
|
|
$t2 = microtime(true);
|
|
|
|
|
die("success runtime:".round($t2-$t1,3).'s');
|
|
|
|
|
echo ("success {$this->date}:ok runtime:".round($t2-$t1,3).'s'.PHP_EOL);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 获取类型为1的数据,按收入类型
|
|
|
|
@ -430,6 +432,8 @@ class FinancialSummarySetController extends \Think\Controller
|
|
|
|
|
$res = $this->FinancialSummaryModel->addAll($this->adddata);
|
|
|
|
|
if(!$res){
|
|
|
|
|
echo "DB save error";
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|