|
|
|
@ -63,11 +63,18 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
//判断公司
|
|
|
|
|
$gfidlag = true;
|
|
|
|
|
$gfgs = true;
|
|
|
|
|
$nwtflag = true;
|
|
|
|
|
if (isset($_REQUEST['company_id'])) {
|
|
|
|
|
if($_REQUEST['company_id']!=0){
|
|
|
|
|
$gfgs = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//判断是否是内团 内团才有官方
|
|
|
|
|
if(isset($_REQUEST['company_belong'])){
|
|
|
|
|
if($_REQUEST['company_belong']!=0){
|
|
|
|
|
$nwtflag = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['promote_id'])) {
|
|
|
|
|
if($_REQUEST['promote_id'] == 0){
|
|
|
|
|
$gfidlag = true;
|
|
|
|
@ -75,28 +82,26 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
$gfidlag =false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if($gfidlag && $gfgs){
|
|
|
|
|
// dd($gfidlag && $gfgs && $nwtflag);
|
|
|
|
|
if($gfidlag && $gfgs && $nwtflag){
|
|
|
|
|
//计算官方渠道
|
|
|
|
|
unset($_REQUEST['company_id']);
|
|
|
|
|
unset($_REQUEST['company_belong']);
|
|
|
|
|
$_REQUEST['promote_id'] = 0;
|
|
|
|
|
$gfcash = self::getJoinPromoteData([],$istimeselect);
|
|
|
|
|
$senddata[0] = $gfcash[0];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!empty($senddata)){
|
|
|
|
|
if(array_key_exists(0,$senddata) || $_REQUEST['promote_id']==0){
|
|
|
|
|
if (empty($_REQUEST['company_id'])) {
|
|
|
|
|
$pmap['status']=1;
|
|
|
|
|
if($istimeselect){
|
|
|
|
|
$pmap['create_time'] = $istimeselect;
|
|
|
|
|
}
|
|
|
|
|
$admininside = M("provide_user p","tab_")->field("sum(amount) amount")->where($pmap)->find();
|
|
|
|
|
if($admininside['amount'] >0){
|
|
|
|
|
$senddata[0]['inside_cash_count']= $admininside['amount'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$pmap['status']=1;
|
|
|
|
|
if($istimeselect){
|
|
|
|
|
$pmap['create_time'] = $istimeselect;
|
|
|
|
|
}
|
|
|
|
|
$admininside = M("provide_user p","tab_")->field("sum(amount) amount")->where($pmap)->find();
|
|
|
|
|
if($admininside['amount'] >0){
|
|
|
|
|
$senddata[0]['inside_cash_count']= $admininside['amount'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
|
$count =array(
|
|
|
|
|
"cash_count"=>0,
|
|
|
|
@ -174,6 +179,7 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
private function getJoinPromoteData($map,$istimeselect,$type="spend")
|
|
|
|
|
{
|
|
|
|
|
// setPowerPromoteIds($map,"s.promote_id");
|
|
|
|
|
//推广员相关检索
|
|
|
|
|
if (isset($_REQUEST['promote_id'])) {
|
|
|
|
|
if ($_REQUEST['promote_id'] == 0) {
|
|
|
|
|
$map['s.promote_id'] = 0;
|
|
|
|
@ -188,6 +194,11 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
$map['promote.company_id'] = $_REQUEST['company_id'];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['company_belong'])) {
|
|
|
|
|
$map['promote.company_belong'] = $_REQUEST['company_belong'];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($type == "spend"){
|
|
|
|
|
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
|
|
|
|
|