This commit is contained in:
chenbo 2023-11-25 10:10:17 +08:00
parent 13ae414917
commit 7bd126f091
2 changed files with 18 additions and 18 deletions

View File

@ -62,7 +62,7 @@ class CronController extends BaseApiController
*/ */
public function settlement(){ public function settlement(){
// $all=TaskSchedulingPlan::where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray(); // $all=TaskSchedulingPlan::where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray();
$all = TaskSchedulingPlan::whereDay('end_time','yesterday') $all = TaskSchedulingPlan::whereDay('end_time','today')
->withJoin(['scheduling'], 'left') ->withJoin(['scheduling'], 'left')
->where('scheduling.company_type', 18) ->where('scheduling.company_type', 18)
->where('is_pay',0) ->where('is_pay',0)

View File

@ -954,7 +954,7 @@ class TaskLogic extends BaseLogic
$taskTemplateInfo = $taskSchedulePlan['template_info']; $taskTemplateInfo = $taskSchedulePlan['template_info'];
$taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find(); $taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find();
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find(); $townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
// 任务交易池,用于叠加交易额 // 任务交易池,用于叠加交易额
$townTransactionPool = $taskTemplateInfo['transaction_pool']; $townTransactionPool = $taskTemplateInfo['transaction_pool'];
@ -993,7 +993,7 @@ class TaskLogic extends BaseLogic
$dayCount = $taskTemplateInfo['day_count']; $dayCount = $taskTemplateInfo['day_count'];
$taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find(); $taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find();
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find(); $townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
// 行政村数量 // 行政村数量
$villageCount = Db::name('geo_village')->where(['street_code' => $townCompany['street']])->count(); $villageCount = Db::name('geo_village')->where(['street_code' => $townCompany['street']])->count();
@ -1001,7 +1001,7 @@ class TaskLogic extends BaseLogic
throw new Exception('没有找到对应的行政村'.__FILE__.__LINE__); 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'=>$townPlatformCompany['responsible_area']], true); $villageCompanyList = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(street,:responsible_area)", ['company_type' => 17,'responsible_area'=>$townPlatformCompany['responsible_area']], true);
$ids = array_column($villageCompanyList, 'id'); $ids = array_column($villageCompanyList, 'id');
// 村联络员数量 // 村联络员数量
$liaisonManCount = User::where(['group_id'=>17])->whereIn('company_id', $ids)->count(); $liaisonManCount = User::where(['group_id'=>17])->whereIn('company_id', $ids)->count();
@ -1051,7 +1051,7 @@ class TaskLogic extends BaseLogic
$dayCount = $taskTemplateInfo['day_count']; $dayCount = $taskTemplateInfo['day_count'];
$taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find(); $taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find();
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find(); $townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
// 行政村数量 // 行政村数量
$villageCount = Db::name('geo_village')->whereIn('street_code', explode(',', $townPlatformCompany['responsible_area']))->count(); $villageCount = Db::name('geo_village')->whereIn('street_code', explode(',', $townPlatformCompany['responsible_area']))->count();
@ -1255,7 +1255,7 @@ class TaskLogic extends BaseLogic
$templateInfo = $taskSchedulePlan['template_info']; $templateInfo = $taskSchedulePlan['template_info'];
$dayCount = $templateInfo['day_count']; $dayCount = $templateInfo['day_count'];
$townCompany = Company::where(['id' => $templateInfo['company_id']])->find(); $townCompany = Company::where(['id' => $templateInfo['company_id']])->find();
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
$taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find(); $taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find();
// 当前任务进行天数 < 第一阶段天数 只刷新任务时间 // 当前任务进行天数 < 第一阶段天数 只刷新任务时间
@ -1310,7 +1310,7 @@ class TaskLogic extends BaseLogic
{ {
$templateInfo = $taskSchedulePlan['template_info']; $templateInfo = $taskSchedulePlan['template_info'];
$townCompany = Company::where(['id' => $templateInfo['company_id']])->find(); $townCompany = Company::where(['id' => $templateInfo['company_id']])->find();
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
$taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find(); $taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find();
// 商城商户入驻申请id 与商户已关联 // 商城商户入驻申请id 与商户已关联
@ -1396,7 +1396,7 @@ class TaskLogic extends BaseLogic
{ {
$templateInfo = $taskSchedulePlan['template_info']; $templateInfo = $taskSchedulePlan['template_info'];
$townCompany = Company::where(['id' => $templateInfo['company_id']])->find(); $townCompany = Company::where(['id' => $templateInfo['company_id']])->find();
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
$taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find(); $taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find();
// 商城商户入驻申请id 与商户已关联 // 商城商户入驻申请id 与商户已关联
@ -1552,7 +1552,7 @@ class TaskLogic extends BaseLogic
{ {
$templateInfo = $taskSchedulePlan['template_info']; $templateInfo = $taskSchedulePlan['template_info'];
$townCompany = Company::where(['id' => $templateInfo['company_id']])->find(); $townCompany = Company::where(['id' => $templateInfo['company_id']])->find();
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
$taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find(); $taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find();
// 商城商户入驻申请id 与商户已关联 // 商城商户入驻申请id 与商户已关联
@ -1720,7 +1720,7 @@ class TaskLogic extends BaseLogic
$totalMoney = bcmul($templateInfo['stage_day_one'], $templateInfo['money']); // 任务最多可得金额 $totalMoney = bcmul($templateInfo['stage_day_one'], $templateInfo['money']); // 任务最多可得金额
$target = $templateInfo['extend']['target']; $target = $templateInfo['extend']['target'];
$taskMoney = 0; $taskMoney = 0;
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
if ($dayCount == $templateInfo['stage_day_one']) { if ($dayCount == $templateInfo['stage_day_one']) {
$taskMoney = -1; $taskMoney = -1;
@ -1888,7 +1888,7 @@ class TaskLogic extends BaseLogic
*/ */
private static function judgeTaskMarketingDirector7($townCompany) private static function judgeTaskMarketingDirector7($townCompany)
{ {
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
$taskIsDone = true; $taskIsDone = true;
// 商城商户入驻申请id 与商户已关联 // 商城商户入驻申请id 与商户已关联
@ -1933,7 +1933,7 @@ class TaskLogic extends BaseLogic
$dayCount = $templateInfo['day_count']; $dayCount = $templateInfo['day_count'];
$stageDayOne = $templateInfo['stage_day_one']; $stageDayOne = $templateInfo['stage_day_one'];
$townCompany = Company::where(['id' => $templateInfo['company_id']])->find(); $townCompany = Company::where(['id' => $templateInfo['company_id']])->find();
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
$taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find(); $taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find();
// 任务累计天数 < 第一阶段 关闭任务 // 任务累计天数 < 第一阶段 关闭任务
@ -2006,7 +2006,7 @@ class TaskLogic extends BaseLogic
private static function countMonthTaskMoney($templateInfo, $townCompany, $targetProcureAmount, $startTime, $endTime) private static function countMonthTaskMoney($templateInfo, $townCompany, $targetProcureAmount, $startTime, $endTime)
{ {
$totalMoney = bcmul(30, $templateInfo['money']); $totalMoney = bcmul(30, $templateInfo['money']);
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
$param = [ $param = [
'start_time' => $startTime, 'start_time' => $startTime,
@ -2066,7 +2066,7 @@ class TaskLogic extends BaseLogic
$dayCount = $templateInfo['day_count']; $dayCount = $templateInfo['day_count'];
$stageDayOne = $templateInfo['stage_day_one']; $stageDayOne = $templateInfo['stage_day_one'];
$townCompany = Company::where(['id' => $templateInfo['company_id']])->find(); $townCompany = Company::where(['id' => $templateInfo['company_id']])->find();
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
$taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find(); $taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find();
@ -2139,7 +2139,7 @@ class TaskLogic extends BaseLogic
private static function countTradeAmountMonthTaskMoney($templateInfo, $townCompany, $targetProcureAmount, $startTime, $endTime) private static function countTradeAmountMonthTaskMoney($templateInfo, $townCompany, $targetProcureAmount, $startTime, $endTime)
{ {
$totalMoney = bcmul(30, $templateInfo['money']); $totalMoney = bcmul(30, $templateInfo['money']);
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
$param = [ $param = [
'start_time' => $startTime, 'start_time' => $startTime,
@ -2470,7 +2470,7 @@ class TaskLogic extends BaseLogic
Log::info(['镇合伙人公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]); Log::info(['镇合伙人公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
$taskTemplateInfo = $taskSchedulePlan['template_info']; $taskTemplateInfo = $taskSchedulePlan['template_info'];
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find(); $townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
$groupServiceCompanyList = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(street,:responsible_area)", ['company_type' => 18,'responsible_area'=>$townPlatformCompany['responsible_area']], true); $groupServiceCompanyList = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(street,:responsible_area)", ['company_type' => 18,'responsible_area'=>$townPlatformCompany['responsible_area']], true);
// $groupServiceCompanyList = Company::where(['street' => $townCompany['street'], 'company_type' => 18])->select()->toArray(); // $groupServiceCompanyList = Company::where(['street' => $townCompany['street'], 'company_type' => 18])->select()->toArray();
@ -2622,7 +2622,7 @@ class TaskLogic extends BaseLogic
Log::info(['镇农科公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]); Log::info(['镇农科公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]);
$taskTemplateInfo = $taskSchedulePlan['template_info']; $taskTemplateInfo = $taskSchedulePlan['template_info'];
$townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find(); $townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find();
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
$townTask = Task::where('id', $taskSchedulePlan['task_id'])->find(); $townTask = Task::where('id', $taskSchedulePlan['task_id'])->find();
// $groupServiceCompanyList = Company::where(['street' => $townCompany['street'], 'company_type'=> 18])->select()->toArray(); // $groupServiceCompanyList = Company::where(['street' => $townCompany['street'], 'company_type'=> 18])->select()->toArray();
@ -2723,7 +2723,7 @@ class TaskLogic extends BaseLogic
$taskTemplateInfo = $taskSchedulePlan['template_info']; $taskTemplateInfo = $taskSchedulePlan['template_info'];
$townCompany = Company::where('id', $taskTemplateInfo['company_id'])->find(); // 镇合伙人公司 $townCompany = Company::where('id', $taskTemplateInfo['company_id'])->find(); // 镇合伙人公司
$townPlatformCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0]; $townPlatformCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$townCompany['street']], true)[0];
$task = Task::where('id', $taskSchedulePlan['task_id'])->find(); $task = Task::where('id', $taskSchedulePlan['task_id'])->find();