|
|
|
@ -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);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -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"]);
|
|
|
|
|
}
|
|
|
|
@ -819,7 +804,6 @@ class CompanyStatementController extends ThinkController
|
|
|
|
|
$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'];
|
|
|
|
|