|
|
|
@ -472,15 +472,24 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
$promote_ids = array_column($promote_data,"id");
|
|
|
|
|
|
|
|
|
|
$statement_info = json_decode($value['statement_info'],true);
|
|
|
|
|
// dump($statement_info);
|
|
|
|
|
|
|
|
|
|
$statement_begin_time = $value['statement_begin_time'];
|
|
|
|
|
$statement_end_time = $value['statement_end_time'];
|
|
|
|
|
|
|
|
|
|
$user_data = SM("user", "tab_")
|
|
|
|
|
->field("id")
|
|
|
|
|
->where([
|
|
|
|
|
'promote_id' => ['in', $promote_ids],
|
|
|
|
|
"register_time" => ['between', [$statement_begin_time, $statement_end_time]]
|
|
|
|
|
])->select();
|
|
|
|
|
|
|
|
|
|
$amount_data['user_newcount'] += count($user_data);
|
|
|
|
|
|
|
|
|
|
if ($value['company_type'] == 1) {
|
|
|
|
|
|
|
|
|
|
$list = array_merge($list,$statement_info);
|
|
|
|
|
foreach ($statement_info as $k => $v) {
|
|
|
|
|
|
|
|
|
|
$statement_begin_time = strtotime(str_replace(".", "-", $v['statement_begin_time']));
|
|
|
|
|
$statement_end_time = strtotime(str_replace(".", "-", $v['statement_end_time'])) + 86399;
|
|
|
|
|
|
|
|
|
|
if (!$amount_data['statement_begin_time'] || $amount_data['statement_begin_time'] > $v['statement_begin_time']) {
|
|
|
|
|
$amount_data['statement_begin_time'] = $v['statement_begin_time'];
|
|
|
|
|
}
|
|
|
|
@ -489,13 +498,7 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
$amount_data['statement_end_time'] = $v['statement_end_time'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$user_data = SM("user", "tab_")
|
|
|
|
|
->field("id")
|
|
|
|
|
->where([
|
|
|
|
|
'promote_id' => ['in', $promote_ids],
|
|
|
|
|
'fgame_name' => ['like', "%{$v['game_name']}%"],
|
|
|
|
|
"register_time" => ['between', [$statement_begin_time, $statement_end_time]]
|
|
|
|
|
])->select();
|
|
|
|
|
|
|
|
|
|
if ($v['game_name'] != '罚款' && $v['game_name'] != '奖励') {
|
|
|
|
|
$amount_data['pay_amount'] += $v["pay_amount"];
|
|
|
|
|
}
|
|
|
|
@ -504,7 +507,6 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
} else {
|
|
|
|
|
$amount_data['sum_money'] += $v["sum_money"];
|
|
|
|
|
}
|
|
|
|
|
$amount_data['user_newcount'] += count($user_data);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} elseif($value['company_type'] == 2) {
|
|
|
|
@ -516,8 +518,6 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
$list = array_merge($list,$game_list);
|
|
|
|
|
|
|
|
|
|
foreach ($game_list as $gk=>$gv) {
|
|
|
|
|
$statement_begin_time = strtotime(str_replace(".", "-", $gv['statement_begin_time']));
|
|
|
|
|
$statement_end_time = strtotime(str_replace(".", "-", $gv['statement_end_time'])) + 86399;
|
|
|
|
|
|
|
|
|
|
if (!$amount_data['statement_begin_time'] || $amount_data['statement_begin_time'] > $gv['statement_begin_time']) {
|
|
|
|
|
$amount_data['statement_begin_time'] = $gv['statement_begin_time'];
|
|
|
|
@ -527,13 +527,6 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
$amount_data['statement_end_time'] = $gv['statement_end_time'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$user_data = SM("user", "tab_")
|
|
|
|
|
->field("id")
|
|
|
|
|
->where([
|
|
|
|
|
'promote_id' => ['in', $promote_ids],
|
|
|
|
|
'fgame_name' => ['like', "%{$gv['game_name']}%"],
|
|
|
|
|
"register_time" => ['between', [$statement_begin_time, $statement_end_time]]
|
|
|
|
|
])->select();
|
|
|
|
|
if ($gv['game_name'] != '罚款' && $gv['game_name'] != '奖励') {
|
|
|
|
|
$amount_data['pay_amount'] += $gv["pay_amount"];
|
|
|
|
|
}
|
|
|
|
@ -543,7 +536,7 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
} else {
|
|
|
|
|
$amount_data['sum_money'] += $gv["sum_money"];
|
|
|
|
|
}
|
|
|
|
|
$amount_data['user_newcount'] += count($user_data);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -629,21 +622,6 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
|
|
|
|
|
foreach ($company_id as $ckey => $cvalue) {
|
|
|
|
|
|
|
|
|
|
$use_data = [
|
|
|
|
|
"01"=>["time"=>"01"],
|
|
|
|
|
"02"=>["time"=>"02"],
|
|
|
|
|
"03"=>["time"=>"03"],
|
|
|
|
|
"04"=>["time"=>"04"],
|
|
|
|
|
"05"=>["time"=>"05"],
|
|
|
|
|
"06"=>["time"=>"06"],
|
|
|
|
|
"07"=>["time"=>"07"],
|
|
|
|
|
"08"=>["time"=>"08"],
|
|
|
|
|
"09"=>["time"=>"09"],
|
|
|
|
|
"10"=>["time"=>"10"],
|
|
|
|
|
"11"=>["time"=>"11"],
|
|
|
|
|
"12"=>["time"=>"12"],
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$map["company_id"] = $cvalue;
|
|
|
|
|
$map['company_belong'] = 9;
|
|
|
|
|
|
|
|
|
@ -652,6 +630,21 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
->where($map)
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
$use_data = [
|
|
|
|
|
"01"=>["time"=>"01","show_company_name"=>$data[0]["company_name"]],
|
|
|
|
|
"02"=>["time"=>"02","show_company_name"=>$data[0]["company_name"]],
|
|
|
|
|
"03"=>["time"=>"03","show_company_name"=>$data[0]["company_name"]],
|
|
|
|
|
"04"=>["time"=>"04","show_company_name"=>$data[0]["company_name"]],
|
|
|
|
|
"05"=>["time"=>"05","show_company_name"=>$data[0]["company_name"]],
|
|
|
|
|
"06"=>["time"=>"06","show_company_name"=>$data[0]["company_name"]],
|
|
|
|
|
"07"=>["time"=>"07","show_company_name"=>$data[0]["company_name"]],
|
|
|
|
|
"08"=>["time"=>"08","show_company_name"=>$data[0]["company_name"]],
|
|
|
|
|
"09"=>["time"=>"09","show_company_name"=>$data[0]["company_name"]],
|
|
|
|
|
"10"=>["time"=>"10","show_company_name"=>$data[0]["company_name"]],
|
|
|
|
|
"11"=>["time"=>"11","show_company_name"=>$data[0]["company_name"]],
|
|
|
|
|
"12"=>["time"=>"12","show_company_name"=>$data[0]["company_name"]],
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$row = 0;
|
|
|
|
|
|
|
|
|
|
foreach($data as $key => $value) {
|
|
|
|
@ -661,7 +654,7 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
$statement_info = $data[$key]['statement_info'];
|
|
|
|
|
|
|
|
|
|
$data[$key]['row'] = count($data[$key]['statement_info']);
|
|
|
|
|
|
|
|
|
|
$data[$key]['show_company_name'] = $value["company_name"];
|
|
|
|
|
$row += $data[$key]['row'];
|
|
|
|
|
|
|
|
|
|
foreach ($statement_info as $k => $v) {
|
|
|
|
@ -729,8 +722,6 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
|
|
|
|
|
$check_list = array_column(json_decode($_POST["list"],true),"game_name");
|
|
|
|
|
|
|
|
|
|
// dump($check_list);die();
|
|
|
|
|
|
|
|
|
|
if (!$company_id) {
|
|
|
|
|
$data = [];
|
|
|
|
|
} else {
|
|
|
|
@ -750,6 +741,22 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
|
|
|
|
|
$statement_info = json_decode($value['statement_info'], true);
|
|
|
|
|
|
|
|
|
|
$statement_begin_time = $value['statement_begin_time'];
|
|
|
|
|
$statement_end_time = $value['statement_end_time'];
|
|
|
|
|
|
|
|
|
|
$user_data = [];
|
|
|
|
|
if ($promote_ids) {
|
|
|
|
|
$user_data = SM("user", "tab_")
|
|
|
|
|
->field("id")
|
|
|
|
|
->where([
|
|
|
|
|
'promote_id' => ['in', $promote_ids?$promote_ids:0],
|
|
|
|
|
"register_time" => ['between', [$statement_begin_time, $statement_end_time]]
|
|
|
|
|
])->select();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$amount_data['user_newcount'] += count($user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($value['company_type'] == 1) {
|
|
|
|
|
// $list = array_merge(, $statement_info);
|
|
|
|
@ -757,16 +764,7 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
if (!in_array($v["game_name"],$check_list)) {
|
|
|
|
|
array_push($list,$v);
|
|
|
|
|
}
|
|
|
|
|
$statement_begin_time = strtotime(str_replace(".", "-", $v['statement_begin_time']));
|
|
|
|
|
$statement_end_time = strtotime(str_replace(".", "-", $v['statement_end_time'])) + 86399;
|
|
|
|
|
|
|
|
|
|
$user_data = SM("user", "tab_")
|
|
|
|
|
->field("id")
|
|
|
|
|
->where([
|
|
|
|
|
'promote_id' => ['in', $promote_ids?$promote_ids:0],
|
|
|
|
|
'fgame_name' => ['like', "%{$v['game_name']}%"],
|
|
|
|
|
"register_time" => ['between', [$statement_begin_time, $statement_end_time]]
|
|
|
|
|
])->select();
|
|
|
|
|
|
|
|
|
|
if ($v['game_name'] != '罚款' && $v['game_name'] != '奖励') {
|
|
|
|
|
$amount_data['pay_amount'] += $v["pay_amount"];
|
|
|
|
|
}
|
|
|
|
@ -777,8 +775,6 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
$amount_data['sum_money'] += $v["sum_money"];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$amount_data['user_newcount'] += count($user_data);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} elseif($value['company_type'] == 2) {
|
|
|
|
|
foreach ($statement_info as $k => $v) {
|
|
|
|
@ -790,9 +786,6 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
array_push($list,$gv);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$statement_begin_time = strtotime(str_replace(".", "-", $gv['statement_begin_time']));
|
|
|
|
|
$statement_end_time = strtotime(str_replace(".", "-", $gv['statement_end_time'])) + 86399;
|
|
|
|
|
|
|
|
|
|
if (!$amount_data['statement_begin_time'] || $amount_data['statement_begin_time'] > $gv['statement_begin_time']) {
|
|
|
|
|
$amount_data['statement_begin_time'] = $gv['statement_begin_time'];
|
|
|
|
|
}
|
|
|
|
@ -801,14 +794,6 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
$amount_data['statement_end_time'] = $gv['statement_end_time'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$user_data = SM("user", "tab_")
|
|
|
|
|
->field("id")
|
|
|
|
|
->where([
|
|
|
|
|
'promote_id' => ['in', $promote_ids?$promote_ids:0],
|
|
|
|
|
'fgame_name' => ['like', "%{$gv['game_name']}%"],
|
|
|
|
|
"register_time" => ['between', [$statement_begin_time, $statement_end_time]]
|
|
|
|
|
])->select();
|
|
|
|
|
|
|
|
|
|
if ($gv['game_name'] != '罚款' && $gv['game_name'] != '奖励') {
|
|
|
|
|
$amount_data['pay_amount'] += floatval($gv["pay_amount"]);
|
|
|
|
|
}
|
|
|
|
@ -818,8 +803,7 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
} else {
|
|
|
|
|
$amount_data['sum_money'] += floatval($gv["sum_money"]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$amount_data['user_newcount'] += count($user_data);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -903,7 +887,7 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
$save['statement_begin_time'] = strtotime(str_replace(".", "-", $amount_data['statement_begin_time']));
|
|
|
|
|
$save['statement_end_time'] = strtotime(str_replace(".", "-", $amount_data['statement_end_time'])) + 86399;
|
|
|
|
|
$save['pay_amount'] = $amount_data['pay_amount'];
|
|
|
|
|
$save['sum_money'] = $amount_data['sum_money']-($amount_data['sum_money']*$_POST['fax_ratio']/100);
|
|
|
|
|
$save['sum_money'] = $amount_data['sum_money'];
|
|
|
|
|
$save['user_newcount'] = $amount_data['user_newcount'];
|
|
|
|
|
$save['fax_ratio'] = $_POST['fax_ratio'];
|
|
|
|
|
$save['statement_ids'] = $_POST['id'].','.$_POST['other_id'];
|
|
|
|
|