searchLiaisonMan($company['id']); Log::info([$taskSchedulePlan['template_info']['title'].'结算-村联络员用户信息', $liaisonMan]); // 用户收益变动 $arr = [$liaisonMan['id'], AccountLogEnum::UM_INC_TASK, AccountLogEnum::INC, $masterMoney, $taskSchedulePlan['sn'], $remark.'任务结算获得收益' . $masterMoney . '元', ['company_id' => $company['id'], 'proportion' => $proportion], 1]; $this->master($arr); // 用户余额变动 $arr_two = [$liaisonMan['id'], AccountLogEnum::UM_INC_TASKUSER, AccountLogEnum::INC, $masterMoney, $taskSchedulePlan['sn'], $remark . '获得账户余额' . $masterMoney . '元', ['company_id' => $company['id'], 'proportion' => $proportion], 1]; $this->Account($arr_two); // 公司收益 $deposit_count = bcadd($company['deposit'], $masterMoney, 2); // 公司收益变动记录 $this->AccountLog($company['id'], $deposit_count, $masterMoney, 1, CompanyAccountLog::TASK_INC_INCOME); $company_money_count = bcadd($company['company_money'], $masterMoney, 2); //公司余额变动记录 $this->AccountLog($company['id'], $company_money_count, $masterMoney, 1, CompanyAccountLog::TASK_INC_COMPANY_MONEY); // 变更公司收益和余额 Company::where('id', $company['id'])->update(['deposit' => Db::raw('deposit+' . $masterMoney), 'company_money' => Db::raw('company_money+' . $masterMoney)]); } public function dealVillageTaskSettlement1(Task $taskInfo, Company $townCompany, $taskSchedulePlan) { try { Db::startTrans(); $this->shareProfit($taskInfo, $townCompany, $taskSchedulePlan); // 更改结算状态 (new TaskSchedulingPlan())->settlement($taskSchedulePlan['id']); // 更改任务状态 Task::where(['id' => $taskSchedulePlan['task_id']])->update(['status' => 3,'money' => $taskInfo['money']]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); Log::error($taskSchedulePlan['template_info']['title'].'-任务结算失败:' . $e->getMessage()); return false; } } public function dealVillageTaskSettlement2($taskInfo, $townCompany, $taskSchedulePlan, $leftTransactionPool) { try { Db::startTrans(); $this->shareProfit($taskInfo, $townCompany, $taskSchedulePlan); // 更改结算状态 (new TaskSchedulingPlan())->settlement($taskSchedulePlan['id']); // 更改任务状态 Task::where(['id' => $taskSchedulePlan['task_id']])->update(['status' => 3,'money' => $taskInfo['money']]); // 更新镇交易池 (new TaskTemplate())->updateTransactionPool($taskSchedulePlan['template_info']['id'], $leftTransactionPool); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); Log::error($taskSchedulePlan['template_info']['title'].'-任务结算失败:' . $e->getMessage()); return false; } } public function dealVillageTaskSettlement3($taskInfo, $townCompany, $taskSchedulePlan, $leftTransactionPool) { try { Db::startTrans(); $this->shareProfit($taskInfo, $townCompany, $taskSchedulePlan); // 更改结算状态 (new TaskSchedulingPlan())->settlement($taskSchedulePlan['id']); // 更改任务状态 Task::where(['id' => $taskSchedulePlan['task_id']])->update(['status' => 3,'money' => $taskInfo['money']]); // 更新镇交易池 (new TaskTemplate())->updateTransactionPool($taskSchedulePlan['template_info']['id'], $leftTransactionPool); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); Log::error($taskSchedulePlan['template_info']['title'].'-任务结算失败:' . $e->getMessage()); return false; } } public function dealVillageTaskSettlement4(Task $taskInfo, Company $townCompany, $taskSchedulePlan) { try { Db::startTrans(); $this->shareProfit($taskInfo, $townCompany, $taskSchedulePlan); // 更改结算状态 (new TaskSchedulingPlan())->settlement($taskSchedulePlan['id']); // 更改任务状态 Task::where(['id' => $taskSchedulePlan['task_id']])->update(['status' => 3,'money' => $taskInfo['money']]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); Log::error($taskSchedulePlan['template_info']['title'].'-任务结算失败:' . $e->getMessage()); return false; } } public function dealVillageTaskSettlement5(Task $taskInfo, Company $townCompany, $taskSchedulePlan) { try { Db::startTrans(); $this->shareProfit($taskInfo, $townCompany, $taskSchedulePlan); // 更改结算状态 (new TaskSchedulingPlan())->settlement($taskSchedulePlan['id']); // 更改任务状态 Task::where(['id' => $taskSchedulePlan['task_id']])->update(['status' => 3,'money' => $taskInfo['money']]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); Log::error($taskSchedulePlan['template_info']['title'].'-任务结算失败:' . $e->getMessage()); return false; } } public function dealVillageTaskSettlement6(Task $taskInfo, Company $townCompany, $taskSchedulePlan) { try { Db::startTrans(); $this->shareProfit($taskInfo, $townCompany, $taskSchedulePlan); // 更改结算状态 (new TaskSchedulingPlan())->settlement($taskSchedulePlan['id']); // 更改任务状态 Task::where(['id' => $taskSchedulePlan['task_id']])->update(['status' => 3,'money' => $taskInfo['money']]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); Log::error($taskSchedulePlan['template_info']['title'].'-任务结算失败:' . $e->getMessage()); return false; } } public function dealVillageTaskSettlement7(Task $taskInfo, Company $townCompany, $taskSchedulePlan) { try { Db::startTrans(); $this->shareProfit($taskInfo, $townCompany, $taskSchedulePlan); // 更改结算状态 (new TaskSchedulingPlan())->settlement($taskSchedulePlan['id']); // 更改任务状态 Task::where(['id' => $taskSchedulePlan['task_id']])->update(['status' => 3,'money' => $taskInfo['money']]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); Log::error($taskSchedulePlan['template_info']['title'].'-任务结算失败:' . $e->getMessage()); return false; } } public function dealVillageTaskSettlement8(Task $taskInfo, Company $townCompany, $taskSchedulePlan) { try { Db::startTrans(); $this->shareProfit($taskInfo, $townCompany, $taskSchedulePlan); // 更改结算状态 (new TaskSchedulingPlan())->settlement($taskSchedulePlan['id']); // 更改任务状态 Task::where(['id' => $taskSchedulePlan['task_id']])->update(['status' => 3,'money' => $taskInfo['money']]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); Log::error($taskSchedulePlan['template_info']['title'].'-任务结算失败:' . $e->getMessage()); return false; } } }