财务子系统bug修复

master
zhengyongxing 4 years ago
parent ae3ad391fd
commit 3900a4081a

@ -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'];

@ -118,8 +118,8 @@
<td>{$data[0]['game_name']}</td>
<td rowspan="{$row}" class="pay_amount">{$amount_data['pay_amount']}</td>
<td rowspan="{$row}" class="user_newcount">{$amount_data['user_newcount']}</td>
<td rowspan="{$row}" class="parent_fax_ratio"><input class="fax_ratio" type="text" class="txt" name="fax_ratio" value="0" placeholder="" style="width: 25px">%</td>
<td rowspan="{$row}" class="sum_money">{$amount_data['sum_money']}</td>
<td rowspan="{$row}" class="parent_fax_ratio"><input class="fax_ratio txt" type="text" name="fax_ratio" value="0" placeholder="" style="width: 25px">%</td>
<td rowspan="{$row}" class = "parent_sum_money"><input class="sum_money txt" type="text" name="sum_money" value="{$amount_data['sum_money']}" placeholder="" style="width: 88px;text-align: right;"></td>
</tr>
<foreach name="data" item="it" key="key">
@ -153,7 +153,7 @@
$(function () {
var sum_amount = parseFloat($(".sum_money").text());
var sum_amount = parseFloat($(".sum_money").val());
var row = 0;
var amount_datas;
var other_list;
@ -202,6 +202,21 @@
});
$(".sum_money").blur(function() {
var pay_amount = parseFloat($(".pay_amount").text());
sum_amount = parseFloat($(this).val());
if (sum_amount > pay_amount) {
sum_amount = pay_amount;
$(this).val(sum_amount)
}
var jsonObj = JSON.parse(amount_datas);
jsonObj["sum_money"] = sum_amount;
amount_datas = JSON.stringify(jsonObj);
});
$("#promote_company").change(function () {
var begin = $(".time").data("begin");
var end = $(".time").data("end");
@ -219,7 +234,7 @@
$(".pay_amount").attr("rowspan",parseInt($(".pay_amount").attr('rowspan'))-row);
$(".user_newcount").attr("rowspan",parseInt($(".user_newcount").attr('rowspan'))-row);
$(".parent_fax_ratio").attr("rowspan",parseInt($(".parent_fax_ratio").attr('rowspan'))-row);
$(".sum_money").attr("rowspan",parseInt($(".sum_money").attr('rowspan'))-row);
$(".parent_sum_money").attr("rowspan",parseInt($(".parent_sum_money").attr('rowspan'))-row);
layer.load(2);
$.ajax({
@ -244,12 +259,12 @@
$(".pay_amount").text(data.amount_data['pay_amount']);
$(".user_newcount").text(data.amount_data['user_newcount']);
// $(".fax_ratio").text(data.amount_data['pay_amount']);
$(".sum_money").text(data.amount_data['sum_money']);
$(".sum_money").val(data.amount_data['sum_money']);
$(".pay_amount").attr("rowspan",parseInt($(".pay_amount").attr('rowspan'))+row);
$(".user_newcount").attr("rowspan",parseInt($(".user_newcount").attr('rowspan'))+row);
$(".parent_fax_ratio").attr("rowspan",parseInt($(".parent_fax_ratio").attr('rowspan'))+row);
$(".sum_money").attr("rowspan",parseInt($(".sum_money").attr('rowspan'))+row);
$(".parent_sum_money").attr("rowspan",parseInt($(".parent_sum_money").attr('rowspan'))+row);
sum_amount = data.amount_data['sum_money'];
amount_datas = JSON.stringify(data.amount_data);
other_list = JSON.stringify(data.list);
@ -276,7 +291,7 @@
sum_money = sum_amount-fax_amount;
$(".sum_money").text(sum_money.toFixed(2));
$(".sum_money").val(sum_money.toFixed(2));
});

Loading…
Cancel
Save