|
|
|
@ -104,11 +104,14 @@ class FinanceController extends ThinkController
|
|
|
|
|
$map['count_date']=I('count_date');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!empty(I('root_id'))) {
|
|
|
|
|
if(!empty(I('root_id'))||!I('sign')) {
|
|
|
|
|
$root_id = I('root_id');
|
|
|
|
|
if ($root_id == 0) {
|
|
|
|
|
// $map['_string'] = "promote_id = {$root_id}";
|
|
|
|
|
} else {
|
|
|
|
|
$map['_string'] = "promote_id = {$root_id} or parent_id = {$root_id} or root_id = {$root_id}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if(!empty(I('parent_id'))) {
|
|
|
|
|
$parent_id = I('parent_id');
|
|
|
|
|
$map['_string'] = "promote_id = {$parent_id} or parent_id = {$parent_id}";
|
|
|
|
@ -119,6 +122,9 @@ class FinanceController extends ThinkController
|
|
|
|
|
$map['_string'] = "promote_id = {$promote_id}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// var_dump($map);die();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$map['bind_coin_count'] = ['neq',0];
|
|
|
|
|
$insideData = D("spend_count")->getSpendCountData($map,"game_id,bind_coin_count as count","promote_id,count_date,game_id");
|
|
|
|
|
unset($map['bind_coin_count']);
|
|
|
|
@ -169,7 +175,25 @@ class FinanceController extends ThinkController
|
|
|
|
|
|
|
|
|
|
function gameFinanceDetail($p = 1) {
|
|
|
|
|
|
|
|
|
|
// $this->getPromoteList();die();
|
|
|
|
|
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);
|
|
|
|
|
} else if (I("root_id")==0) {
|
|
|
|
|
$promote_id = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty(I("parent_id"))) {
|
|
|
|
|
$parent_id = I("parent_id");
|
|
|
|
|
$promote_id = $this->getPromoteList($parent_id);
|
|
|
|
|
array_push($promote_id,$parent_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dump($promote_id);die();
|
|
|
|
|
|
|
|
|
|
$page = intval($p);
|
|
|
|
|
$page = $page ? $page : 1; //默认显示第一页数据
|
|
|
|
@ -393,14 +417,14 @@ class FinanceController extends ThinkController
|
|
|
|
|
|
|
|
|
|
function getPromoteList($root_id = 0) {
|
|
|
|
|
|
|
|
|
|
$data = M('promote')
|
|
|
|
|
$data = M('promote','tab_')
|
|
|
|
|
->field("id")
|
|
|
|
|
->where("parent_id={$root_id} and grand_id={$root_id}")
|
|
|
|
|
->where("parent_id={$root_id} or grand_id={$root_id}")
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
$handleData = [];
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
|
array_push($data[$key]['id'],$handleData);
|
|
|
|
|
array_push($handleData,$data[$key]['id']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $handleData;
|
|
|
|
|