@ -63,10 +63,11 @@ class FinancePromoteController extends AdminController
$inside = self::getJoinPromoteData([],$istimeselect,"promote_coin");
foreach($inside as $k=>$v){
if(array_key_exists($v['p_id'],$senddata)){
$senddata[$v['p_id']]['inside_cash_count']= $v['pay_amount'];
$senddata[$v['p_id']]['inside_cash_count']= $v['pay_amount']-$v['back_amount'] ;
}else{
$v['inside_cash_count'] = $v['pay_amount'];
$v['inside_cash_count'] = $v['pay_amount']-$v['back_amount'] ;
unset($v['pay_amount']);
unset($v['back_amount']);
$senddata[$v['p_id']] = $v;
};
}
@ -147,8 +148,7 @@ class FinancePromoteController extends AdminController
}
$map['s.status']=1;
$map['s.source_id']=0;
$map['s.type']=1;
$field= "sum(num) pay_amount,IFNULL(if(substring_index(substring_index(`chain`,'/',2),'/',-1)='',s.promote_id,substring_index(substring_index(`chain`,'/',2),'/',-1)),0) p_id";
$field= "SUM(CASE WHEN s.type = 1 THEN num ELSE 0 END) as pay_amount,SUM(CASE WHEN s.type = 2 THEN num ELSE 0 END) as back_amount,IFNULL(if(substring_index(substring_index(`chain`,'/',2),'/',-1)='',s.promote_id,substring_index(substring_index(`chain`,'/',2),'/',-1)),0) p_id";
return M("promote_coin s","tab_")
->field($field)
->where($map)
@ -564,7 +564,9 @@ class FinancePromoteController extends AdminController
if (!empty(I("game_id"))) {
$map['tab_spend.game_id'] = I("game_id");
}
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
$map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
}
if (isset($_REQUEST['time_start']) & & isset($_REQUEST['time_end'])) {
$map['pay_time'] = ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]];
@ -585,24 +587,6 @@ class FinancePromoteController extends AdminController
}
}
// if (!empty(I("promote_id"))) {
// $promote_id[] = I("promote_id");
// }
// if (!empty(I("root_id"))) {
// $root_id = I("root_id");
// $promote_id = $this->getPromoteList($root_id);
// array_push($promote_id, $root_id);
// }
// if ($_REQUEST['root_id']=='0') {
// $map['tab_spend.promote_id'] = $_REQUEST['root_id'];
// }
// $promote_id = implode(',',$promote_id);
// if ($promote_id) {
// $map['tab_spend.promote_id'] = ['in',$promote_id];
// }
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
@ -657,5 +641,23 @@ class FinancePromoteController extends AdminController
$this->assign('data',$data);
$this->display();
}
//平台币内充弹框
public function insideCoinDetail($p = 1)
{
$isgf = false;//是否事官方渠道
if ($_REQUEST['promote_id'] != '') {
if($_REQUEST['promote_id'] == 0){
$isgf = true;
}
$map['tab_spend.promote_id'] = $_REQUEST['promote_id'];
}
//
if($isgf){
}
}
}