Merge branch 'feature/finance_statement_three' of wmtx/platform into release

优化财务汇总测试收入
master
陈志 4 years ago committed by Gogs
commit c1fbda369b

@ -196,38 +196,38 @@ class FinancialSummarySetController extends \Think\Controller
"type"=>1, "type"=>1,
"sort"=>5 "sort"=>5
); );
//获取测试白名单 // //获取测试白名单
$testlist = M("TestWhiteList",'tab_')->field("user_id")->select(); // $testlist = M("TestWhiteList",'tab_')->field("user_id")->select();
if($testlist){ // if($testlist){
$testlist = implode(",",array_column($testlist, 'user_id')); // $testlist = implode(",",array_column($testlist, 'user_id'));
}else{ // }else{
$testlist = false; // $testlist = false;
} // }
//获取现金充值 // //获取现金充值
$map = array( // $map = array(
"payed_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)), // "payed_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"pay_status"=>1, // "pay_status"=>1,
"pay_way"=>array("GT",0) // "pay_way"=>array("GT",0)
); // );
if($testlist) $map['user_id']=array("in",$testlist); // if($testlist) $map['user_id']=array("in",$testlist);
$cash_spend = $this->SpendModel // $cash_spend = $this->SpendModel
->field("IFNULL(SUM(pay_amount),0) as pay_amount") // ->field("IFNULL(SUM(pay_amount),0) as pay_amount")
->where($map) // ->where($map)
->find()['pay_amount']; // ->find()['pay_amount'];
//获取平台币充值 // //获取平台币充值
$map1 = array( // $map1 = array(
"payed_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)), // "payed_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"pay_status"=>1 // "pay_status"=>1
); // );
if($testlist) $map1['user_id']=array("in",$testlist); // if($testlist) $map1['user_id']=array("in",$testlist);
$deposit = $this->DepositModel->field("IFNULL(sum(pay_amount),0) pay_amount")->where($map1)->find()['pay_amount']; // $deposit = $this->DepositModel->field("IFNULL(sum(pay_amount),0) pay_amount")->where($map1)->find()['pay_amount'];
//测试订单录入 //测试订单录入
$map2 = array( $map2 = array(
"pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)) "pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth))
); );
$test_pay_amount = $this->TestOrderModel->where($map2)->field("IFNULL(sum(pay_amount),0) pay_amount")->find()['pay_amount']; $test_pay_amount = $this->TestOrderModel->where($map2)->field("IFNULL(sum(pay_amount),0) pay_amount")->find()['pay_amount'];
$temparr['sum_money'] = number_format(($cash_spend*100 + $deposit*100 + $test_pay_amount*100 )/100, 2, '.', ''); $temparr['sum_money'] = number_format(($test_pay_amount*100 )/100, 2, '.', '');
$this->adddata[]=$temparr; $this->adddata[]=$temparr;
} }

Loading…
Cancel
Save