|
|
|
@ -53,7 +53,7 @@ class FinancialSummarySetController extends \Think\Controller
|
|
|
|
|
$this->month= $tarry[1];
|
|
|
|
|
$this->beginThismonth=mktime(0,0,0,$tarry[1],1,$tarry[0]);
|
|
|
|
|
$this->endThismonth=mktime(0,0,0,$tarry[1]-0+1,1,$tarry[0])-1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->reCount();
|
|
|
|
|
$this->setFinancialSummary();
|
|
|
|
|
}
|
|
|
|
@ -344,22 +344,19 @@ class FinancialSummarySetController extends \Think\Controller
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setChannelMoney(){
|
|
|
|
|
$Channel = D("PaymentMerchant")->Channel;
|
|
|
|
|
foreach( $Channel as $k=>&$v){
|
|
|
|
|
$v = 0;
|
|
|
|
|
}
|
|
|
|
|
$this->getChannelCount($Channel);
|
|
|
|
|
|
|
|
|
|
$Channel = $this->getChannelCount($Channel);
|
|
|
|
|
foreach( $Channel as $k=>$v){
|
|
|
|
|
$this->adddata[] = array(
|
|
|
|
|
"key_name"=>$k,
|
|
|
|
|
"type"=>4,
|
|
|
|
|
"sort"=>$k,
|
|
|
|
|
"sum_money"=>number_format($v/100, 2, '.', '')
|
|
|
|
|
"sum_money"=>number_format($v, 2, '.', '')
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//获取Channel
|
|
|
|
|
protected function getChannelCount(&$Channel){
|
|
|
|
|
protected function getChannelCount(){
|
|
|
|
|
$map = array(
|
|
|
|
|
"s.payed_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
|
|
|
|
|
"s.pay_status"=>1,
|
|
|
|
@ -425,29 +422,26 @@ class FinancialSummarySetController extends \Think\Controller
|
|
|
|
|
->where($to_map)
|
|
|
|
|
->select();
|
|
|
|
|
$dbres = array_merge($spres,$ssres,$dpres,$cores,$tores);
|
|
|
|
|
$Channel = [];
|
|
|
|
|
foreach ($dbres as $k=>$v){
|
|
|
|
|
$Channel[$v['channel']] = $Channel[$v['channel']]-0;
|
|
|
|
|
$Channel[$v['channel']] += $v['pay_amount'];
|
|
|
|
|
$Channel["c".$v['channel']] += $v['pay_amount'];
|
|
|
|
|
}
|
|
|
|
|
return $Channel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setPaywayMoney(){
|
|
|
|
|
$Ways = D("PaymentMerchant")->Ways;
|
|
|
|
|
foreach( $Ways as $k=>&$v){
|
|
|
|
|
$v = 0;
|
|
|
|
|
}
|
|
|
|
|
$this->getPaywayCount($Ways);
|
|
|
|
|
$Ways = $this->getPaywayCount();
|
|
|
|
|
foreach($Ways as $k=>$v){
|
|
|
|
|
$this->adddata[] = array(
|
|
|
|
|
"key_name"=>$k,
|
|
|
|
|
"type"=>5,
|
|
|
|
|
"sort"=>$k,
|
|
|
|
|
"sum_money"=>number_format($v/100, 2, '.', '')
|
|
|
|
|
"sum_money"=>number_format($v, 2, '.', '')
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//获取Channel
|
|
|
|
|
protected function getPaywayCount(&$Ways){
|
|
|
|
|
protected function getPaywayCount(){
|
|
|
|
|
$map = array(
|
|
|
|
|
"s.payed_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
|
|
|
|
|
"s.pay_status"=>1,
|
|
|
|
@ -509,10 +503,11 @@ class FinancialSummarySetController extends \Think\Controller
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
$dbres = array_merge($spres,$ssres,$dpres,$cores,$tores);
|
|
|
|
|
$Ways = [];
|
|
|
|
|
foreach ($dbres as $k=>$v){
|
|
|
|
|
$Ways[$v['merchant_way']] = $Ways[$v['merchant_way']]-0;
|
|
|
|
|
$Ways[$v['merchant_way']] += $v['pay_amount'];
|
|
|
|
|
$Ways["w".$v['merchant_way']] += $v['pay_amount'];
|
|
|
|
|
}
|
|
|
|
|
return $Ways;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function addDb()
|
|
|
|
|