fixed
This commit is contained in:
parent
2ae4a48c68
commit
081ace2c53
@ -952,6 +952,9 @@ class TaskLogic extends BaseLogic
|
|||||||
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
|
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
|
||||||
// 行政村数量
|
// 行政村数量
|
||||||
$villageCount = Db::name('geo_village')->where(['street_code' => $townCompany['street']])->count();
|
$villageCount = Db::name('geo_village')->where(['street_code' => $townCompany['street']])->count();
|
||||||
|
if ($villageCount == 0) {
|
||||||
|
throw new Exception('没有找到对应的行政村'.__FILE__.__LINE__);
|
||||||
|
}
|
||||||
// 村公司
|
// 村公司
|
||||||
$villageCompanyList = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(street,:responsible_area)", ['company_type' => 17,'responsible_area'=>$townCompany['responsible_area']], true);
|
$villageCompanyList = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(street,:responsible_area)", ['company_type' => 17,'responsible_area'=>$townCompany['responsible_area']], true);
|
||||||
$ids = array_column($villageCompanyList, 'id');
|
$ids = array_column($villageCompanyList, 'id');
|
||||||
@ -1018,7 +1021,9 @@ class TaskLogic extends BaseLogic
|
|||||||
if ($dayCount == $taskTemplateInfo['stage_day_one']) {
|
if ($dayCount == $taskTemplateInfo['stage_day_one']) {
|
||||||
// 目标任务金额 行政村数量*6000 + 小组服务团队数量*3000
|
// 目标任务金额 行政村数量*6000 + 小组服务团队数量*3000
|
||||||
$targetShareholderedMoney = bcadd(bcmul($villageCount, 6000, 2), bcmul($groupServiceCompanyCount, 3000, 2), 2);
|
$targetShareholderedMoney = bcadd(bcmul($villageCount, 6000, 2), bcmul($groupServiceCompanyCount, 3000, 2), 2);
|
||||||
|
if ($targetShareholderedMoney == 0) {
|
||||||
|
throw new Exception('目标任务金额为0异常'.__FILE__.__LINE__);
|
||||||
|
}
|
||||||
$companyIds = [];
|
$companyIds = [];
|
||||||
foreach ($groupServiceCompanyList as $groupServiceCompany) {
|
foreach ($groupServiceCompanyList as $groupServiceCompany) {
|
||||||
$companyIds[] = $groupServiceCompany['id'];
|
$companyIds[] = $groupServiceCompany['id'];
|
||||||
@ -2368,6 +2373,9 @@ class TaskLogic extends BaseLogic
|
|||||||
$task = Task::where('id', $taskSchedulePlan['task_id'])->with('director_info')->find();
|
$task = Task::where('id', $taskSchedulePlan['task_id'])->with('director_info')->find();
|
||||||
// 完成任务情况
|
// 完成任务情况
|
||||||
list($groupServiceCompanyCount, $doneTaskGroupServiceCompanyCount) = self::taskType3DoneInfo($groupServiceCompanyList);
|
list($groupServiceCompanyCount, $doneTaskGroupServiceCompanyCount) = self::taskType3DoneInfo($groupServiceCompanyList);
|
||||||
|
if ($groupServiceCompanyCount == 0) {
|
||||||
|
throw new Exception('小组服务公司数量为0异常'.__FILE__.__LINE__);
|
||||||
|
}
|
||||||
$doneRate = bcdiv($doneTaskGroupServiceCompanyCount, $groupServiceCompanyCount,2);
|
$doneRate = bcdiv($doneTaskGroupServiceCompanyCount, $groupServiceCompanyCount,2);
|
||||||
// <80% 未完成任务 关闭本次任务
|
// <80% 未完成任务 关闭本次任务
|
||||||
if (bccomp($doneRate, 0.8, 2) == -1) {
|
if (bccomp($doneRate, 0.8, 2) == -1) {
|
||||||
@ -2568,7 +2576,9 @@ class TaskLogic extends BaseLogic
|
|||||||
if($taskDayCount == $stageDayTwoAccumulative) {
|
if($taskDayCount == $stageDayTwoAccumulative) {
|
||||||
// 小组服务公司总数
|
// 小组服务公司总数
|
||||||
$groupServiceCompanyCount = Company::where(['street' => $townCompany['street'], 'company_type'=> 18])->count();
|
$groupServiceCompanyCount = Company::where(['street' => $townCompany['street'], 'company_type'=> 18])->count();
|
||||||
|
if ($groupServiceCompanyCount == 0) {
|
||||||
|
throw new Exception('小组服务公司数量为0异常'.__FILE__.__LINE__);
|
||||||
|
}
|
||||||
// 小组服务完成股金上交数
|
// 小组服务完成股金上交数
|
||||||
$sharecapitalPaidCount = 0;
|
$sharecapitalPaidCount = 0;
|
||||||
foreach ($villageCompanyList as $villageCompany) {
|
foreach ($villageCompanyList as $villageCompany) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user