工会统计

master
liuweiwen 5 years ago
parent 28a1efe2f4
commit 809e9d36f1

@ -44,6 +44,7 @@ class FinancePromoteController extends AdminController
foreach($cash as $k=>$v){ foreach($cash as $k=>$v){
$senddata[$v['p_id']] = $v; $senddata[$v['p_id']] = $v;
} }
//内冲 //内冲
$inside = self::getJoinPromoteData([],$istimeselect,"promote_coin"); $inside = self::getJoinPromoteData([],$istimeselect,"promote_coin");
foreach($inside as $k=>$v){ foreach($inside as $k=>$v){
@ -56,20 +57,24 @@ class FinancePromoteController extends AdminController
$senddata[$v['p_id']] = $v; $senddata[$v['p_id']] = $v;
}; };
} }
//官方渠道单算 //官方渠道单算
//判断公司 //判断公司
$gfflah = false; $gfidlag = true;
if (isset($_REQUEST['company_id']) && $_REQUEST['company_id']==0) { $gfgs = true;
$gfflah = true; if (isset($_REQUEST['company_id'])) {
if($_REQUEST['company_id']!=0){
$gfgs = false;
}
} }
if (isset($_REQUEST['promote_id'])) { if (isset($_REQUEST['promote_id'])) {
if($_REQUEST['promote_id'] == 0){ if($_REQUEST['promote_id'] == 0){
$gfflah = true; $gfidlag = true;
}else{ }else{
$gfflah =false; $gfidlag =false;
} }
} }
if($gfflah){ if($gfidlag && $gfgs){
//计算官方渠道 //计算官方渠道
unset($_REQUEST['company_id']); unset($_REQUEST['company_id']);
$_REQUEST['promote_id'] = 0; $_REQUEST['promote_id'] = 0;
@ -145,7 +150,7 @@ class FinancePromoteController extends AdminController
private function getJoinPromoteData($map,$istimeselect,$type="spend") private function getJoinPromoteData($map,$istimeselect,$type="spend")
{ {
// setPowerPromoteIds($map,"s.promote_id"); // setPowerPromoteIds($map,"s.promote_id");
if ($_REQUEST['promote_id'] != '') { if (isset($_REQUEST['promote_id'])) {
if ($_REQUEST['promote_id'] == 0) { if ($_REQUEST['promote_id'] == 0) {
$map['s.promote_id'] = 0; $map['s.promote_id'] = 0;
} else { } else {
@ -159,6 +164,7 @@ class FinancePromoteController extends AdminController
$map['promote.company_id'] = $_REQUEST['company_id']; $map['promote.company_id'] = $_REQUEST['company_id'];
} }
if($type == "spend"){ if($type == "spend"){
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
$map["s.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); $map["s.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
@ -166,7 +172,6 @@ class FinancePromoteController extends AdminController
if($istimeselect){ if($istimeselect){
$map['s.pay_time']=$istimeselect; $map['s.pay_time']=$istimeselect;
} }
$map['s.pay_status']=1; $map['s.pay_status']=1;
$field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count, $field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count, SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,

Loading…
Cancel
Save