fixed
This commit is contained in:
parent
7b40b7d5f5
commit
ebaf3caf5d
@ -449,7 +449,7 @@ class TaskLogic extends BaseLogic
|
||||
return true;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Log::error('镇管理任务结算失败'.$e->getMessage());
|
||||
Log::error(['镇管理任务结算失败',$e]);
|
||||
}
|
||||
|
||||
}
|
||||
@ -762,11 +762,16 @@ class TaskLogic extends BaseLogic
|
||||
$targetAmount = 0; // 镇下属小组服务公司每日 目标总交易额
|
||||
// 查镇所属小组服务公司当日任务目标金额总和
|
||||
foreach ($groupServiceCompanyList as $groupServiceCompany) {
|
||||
$tempTask = Task::withJoin(['task_schedule_plan'],'left')->where('task_schedule_plan.is_pay', 1)->where(['company_id'=> $groupServiceCompany['id'], 'status'=>3, 'type'=>33])->whereDay('start_time','today')->find();
|
||||
$tempTask = Task::where(['company_id'=> $groupServiceCompany['id'], 'status'=>3, 'type'=>33])
|
||||
->whereDay('start_time','today')
|
||||
->find();
|
||||
if ($tempTask) {
|
||||
$extend = json_decode($tempTask['extend'], true);
|
||||
$targetAmount += $extend['transaction']['arr']['day_money'];
|
||||
$townTotalTradeAmount += $extend['transaction']['arr']['total_price'];
|
||||
$plan = TaskSchedulingPlan::where(['id'=>$tempTask['scheduling_plan_id']])->find();
|
||||
if ($plan['is_pay'] == 1) {
|
||||
$extend = json_decode($tempTask['extend'], true);
|
||||
$targetAmount += $extend['transaction']['arr']['day_money'];
|
||||
$townTotalTradeAmount += $extend['transaction']['arr']['total_price'];
|
||||
}
|
||||
}
|
||||
}
|
||||
// 完成条件: 查镇所属小组服务公司当日实际完成金额总和+镇管理公司的资金池 > 查镇所属小组服务公司当日任务目标金额总和
|
||||
@ -793,7 +798,7 @@ class TaskLogic extends BaseLogic
|
||||
$task = Task::where('id', $taskSchedulePlan['task_id'])->find();
|
||||
$stageDayOneAccumulative = $taskTemplateInfo['stage_day_one']; // 第一阶段累计天数
|
||||
$stageDayTwoAccumulative = intval(bcadd($taskTemplateInfo['stage_day_one'], $taskTemplateInfo['stage_day_two'])); // 第二阶段累计天数 第一+第二
|
||||
$townCompany = Company::where('id', $taskTemplateInfo['compay_id'])->find(); // 镇管理公司
|
||||
$townCompany = Company::where('id', $taskTemplateInfo['company_id'])->find(); // 镇管理公司
|
||||
$villageCompanyList = Company::where(['street' => $townCompany['street'], 'company_type'=> 17])->select()->toArray(); // 村管理公司
|
||||
|
||||
// 当前任务进行天数 < 第一+第二阶段天数 只刷新任务时间
|
||||
@ -852,14 +857,14 @@ class TaskLogic extends BaseLogic
|
||||
Log::info(['镇管理公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
|
||||
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
||||
|
||||
$townCompany = Company::where('id', $taskTemplateInfo['compay_id'])->find(); // 镇管理公司
|
||||
$townCompany = Company::where('id', $taskTemplateInfo['company_id'])->find(); // 镇管理公司
|
||||
$task = Task::where('id', $taskSchedulePlan['task_id'])->find();
|
||||
|
||||
// 片区下公司有任一投诉都判定为未完成
|
||||
$isDone = 1;
|
||||
$companyList = Company::where('street', $townCompany['street'])->select()->toArray();
|
||||
foreach ($companyList as $company) {
|
||||
$complain = CompanyComplaintFeedback::where(['company_id', $company['id']])->whereDay('create_time', 'today')->find();
|
||||
$complain = CompanyComplaintFeedback::where(['company_id'=>$company['id']])->whereDay('create_time', 'today')->find();
|
||||
if (!empty($complain)) {
|
||||
$isDone = 0;
|
||||
break;
|
||||
|
@ -16,6 +16,7 @@ namespace app\common\model\task;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\model\task_scheduling_plan\TaskSchedulingPlan;
|
||||
use app\common\model\user\User;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
@ -47,10 +48,6 @@ class Task extends BaseModel
|
||||
{
|
||||
return $this->hasOne(User::class, 'id', 'director_uid')->field(['id', 'nickname', 'avatar']);
|
||||
}
|
||||
public function taskSchedulePlan(){
|
||||
return $this->hasOne(Task::class,'id','task_id');
|
||||
}
|
||||
|
||||
// 关闭任务
|
||||
public function closeTask($id) {
|
||||
return Task::where(['id'=>$id])->save(['status'=>5]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user