fixed
This commit is contained in:
parent
9b558bb32d
commit
de5c213172
@ -2852,19 +2852,12 @@ class TaskLogic extends BaseLogic
|
||||
self::flushTaskTime($taskSchedulePlan);
|
||||
return true;
|
||||
}
|
||||
|
||||
// 任务累计天数 = 第一阶段+第二阶段 任务判定,计算金额,结算分润
|
||||
if ($dayCount == $stageDayCount) {
|
||||
// 目标入股金额
|
||||
$targetShareholderedMoney = bcmul($target, 3000, 2);
|
||||
$companyIds = [];
|
||||
foreach ($groupServiceCompanyList as $company) {
|
||||
$companyIds[] = $company['id'];
|
||||
}
|
||||
// 已入股股金总额
|
||||
$shareholderedMoney = CompanyAccountLog::where(['change_object'=>CompanyAccountLog::SHAREHOLDER, 'change_type'=>CompanyAccountLog::TASK_INC_SHAREHOLDER_MONEY])
|
||||
->whereIn('company_id', $companyIds)
|
||||
->sum('change_amount');
|
||||
// 小组服务股金上交金额
|
||||
$shareholderedMoney = Db::name('company_sharecapital_change_log')->where(['parent_company_id'=>$villageCompany['id']])->sum('amount');
|
||||
|
||||
$rate = bcdiv($shareholderedMoney, $targetShareholderedMoney, 2);
|
||||
if (bccomp($rate, 0.5, 2) == -1) {
|
||||
@ -2884,21 +2877,21 @@ class TaskLogic extends BaseLogic
|
||||
|
||||
// =50% - %59.9 x40%
|
||||
if (bccomp($rate, 0.5, 2) == 0 || (bccomp($rate, 0.5, 2) == 1 && bccomp($rate, 0.599, 2) == -1)) {
|
||||
$settlementMoney= bcmul($totalMoney, 0.4, 2);
|
||||
$settlementMoney= bcmul($rate, bcmul($totalMoney, 0.4, 2), 2);
|
||||
}
|
||||
// =60% - %69.9 x50%
|
||||
if (bccomp($rate, 0.6, 2) == 0 || (bccomp($rate, 0.6, 2) == 1 && bccomp($rate, 0.699, 2) == -1)) {
|
||||
$settlementMoney = bcmul($totalMoney, 0.5, 2);
|
||||
$settlementMoney = bcmul($rate, bcmul($totalMoney, 0.5, 2), 2);;
|
||||
}
|
||||
|
||||
// =70% - %79.9 x60%
|
||||
if (bccomp($rate, 0.7, 2) == 0 || (bccomp($rate, 0.7, 2) == 1 && bccomp($rate, 0.799, 2) == -1)) {
|
||||
$settlementMoney = bcmul($totalMoney, 0.6, 2);
|
||||
$settlementMoney = bcmul($rate, bcmul($totalMoney, 0.6, 2), 2);
|
||||
}
|
||||
|
||||
// =80% - %89.9 x70%
|
||||
if (bccomp($rate, 0.8, 2) == 0 || (bccomp($rate, 0.8, 2) == 1 && bccomp($rate, 0.899, 2) == -1)) {
|
||||
$settlementMoney = bcmul($totalMoney, 0.7, 2);
|
||||
$settlementMoney = bcmul($rate, bcmul($totalMoney, 0.7, 2), 2);
|
||||
}
|
||||
// >=90% x100%
|
||||
if (bccomp($rate, 0.9, 2) == 0 || bccomp($rate, 0.9, 2) == 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user