|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @remark :
|
|
|
|
* @name :AfterCount.php
|
|
|
|
* @name :AfterDayCount.php
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/26 15:28
|
|
...
|
...
|
@@ -16,7 +16,7 @@ use Carbon\Carbon; |
|
|
|
use App\Models\HomeCount\AfterCount as AfterCountModel;
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
|
|
|
|
class AfterCount extends Command
|
|
|
|
class AfterDayCount extends Command
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name and signature of the console command.
|
|
...
|
...
|
@@ -44,6 +44,7 @@ class AfterCount extends Command |
|
|
|
echo date('Y-m-d H:i:s').'统计start->'.PHP_EOL;
|
|
|
|
$saveData = $this->_action();
|
|
|
|
$afterModel = new AfterCountModel();
|
|
|
|
//保存数据
|
|
|
|
$afterModel->insertAll($saveData);
|
|
|
|
echo date('Y-m-d H:i:s').'->统计end'.PHP_EOL;
|
|
|
|
return true;
|
|
...
|
...
|
@@ -62,7 +63,7 @@ class AfterCount extends Command |
|
|
|
$rankDataLogModel = new RankDataLog();
|
|
|
|
$todayMidnight = date('Y-m-d 00:00:00', strtotime('today'));
|
|
|
|
$saveData = [];
|
|
|
|
$projectIdArr = $rankDataLogModel->selectField(['is_compliance'=>1,'lang'=>null,'date'=>date('Y-m-d', strtotime('-3 months'))],'project_id');//3个月前达标的项目id
|
|
|
|
$projectIdArr = $rankDataLogModel->selectField(['is_compliance'=>1,'lang'=>'','date'=>date('Y-m-d', strtotime('-3 months'))],'project_id');//3个月前达标的项目id
|
|
|
|
foreach ($this->after_manager as $key => $valM){
|
|
|
|
$idArr = $this->managerHrModel->selectField(['name'=>['in',$valM]],'id');
|
|
|
|
$project_count = $projectModel->where('gl_project.extend_type',0)
|
|
...
|
...
|
@@ -108,9 +109,9 @@ class AfterCount extends Command |
|
|
|
'project_count'=>$project_count,
|
|
|
|
'qualified_count'=>$qualified_count,
|
|
|
|
'rate'=>$rate,
|
|
|
|
'three_project_count'=>$project_count - $three_project_count,
|
|
|
|
'three_qualified_count'=>$qualified_count - $three_qualified_count,
|
|
|
|
'three_rate'=>$rate - $three_rate,
|
|
|
|
'three_project_count'=>$three_project_count,
|
|
|
|
'three_qualified_count'=>$three_qualified_count,
|
|
|
|
'three_rate'=>$three_rate,
|
|
|
|
'data' => json_encode($data,true)
|
|
|
|
];
|
|
|
|
}
|
...
|
...
|
|