作者 lyh

gx

... ... @@ -85,16 +85,14 @@ class Count extends Command
if($arr === false){
$data[] = $v['test_domain'];
}
//判断数据是否存在
DB::table('gl_count')->insert($arr);
Log::channel('day_count')->error('日期:'.$arr['created_at'].'success: ' .$v['test_domain']);
}
}
}catch (\Exception $e){
echo date('Y-m-d H:i:s') . ' error: ' . '->' . $e->getMessage() . PHP_EOL;
Log::channel('day_count')->error('day_count:失败 ' . $e->getMessage());
Log::channel('day_count')->error('day_count:->error ' . $e->getMessage());
}
Log::channel('day_count')->error('day_count:失败的域名 ' .json_encode($data));
echo date('Y-m-d H:i:s') . ' end: ' . PHP_EOL;
Log::channel('day_count')->error('success:end');
echo $this->error;
}
... ...
... ... @@ -6,6 +6,7 @@ use App\Models\Inquiry\InquiryCount as InquiryCountModel;
use App\Models\Inquiry\InquiryInfo;
use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
/**
* @remark :
... ... @@ -62,20 +63,24 @@ class InquiryCount extends Command
//获取昨天的时间
$yesterday = Carbon::yesterday()->toDateString();
$inquiryInfoModel = new InquiryInfo();
foreach ($this->status as $k=>$v){
$total = $inquiryInfoModel->formatQuery(['created_at'=>['between',[$yesterday.' 00:00:00',$yesterday.' 23:59:59']]])->count();
$untreated = $inquiryInfoModel->formatQuery(['created_at'=>['between',[$yesterday.' 00:00:00',$yesterday.' 23:59:59']],'status'=>1])->count();
$invalid = $inquiryInfoModel->formatQuery(['created_at'=>['between',[$yesterday.' 00:00:00',$yesterday.' 23:59:59']],'status'=>0])->count();
$data[] = [
'type'=>$k,
'day'=>$yesterday,
'total'=>$total ?? 0,
'untreated'=>$untreated ?? 0,
'invalid'=>$invalid ?? 0
];
try {
foreach ($this->status as $k=>$v){
$total = $inquiryInfoModel->formatQuery(['created_at'=>['between',[$yesterday.' 00:00:00',$yesterday.' 23:59:59']]])->count();
$untreated = $inquiryInfoModel->formatQuery(['created_at'=>['between',[$yesterday.' 00:00:00',$yesterday.' 23:59:59']],'status'=>1])->count();
$invalid = $inquiryInfoModel->formatQuery(['created_at'=>['between',[$yesterday.' 00:00:00',$yesterday.' 23:59:59']],'status'=>0])->count();
$data[] = [
'type'=>$k,
'day'=>$yesterday,
'total'=>$total ?? 0,
'untreated'=>$untreated ?? 0,
'invalid'=>$invalid ?? 0
];
}
$inquiryCount = new InquiryCountModel();
$inquiryCount->insert($data);
}catch (\Exception $e){
Log::error('inquiry_count : error');
}
$inquiryCount = new InquiryCountModel();
$inquiryCount->insert($data);
return true;
}
}
... ...
... ... @@ -81,7 +81,7 @@ class DeleteBlogCategory extends Command
echo 'success:' . $item['id'] . PHP_EOL;
}catch (\Exception $e){
echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
errorLog('项目初始化失败', $item, $e);
errorLog('delete_blog_category删除失败', $item, $e);
}
}
return true;
... ...
... ... @@ -81,7 +81,7 @@ class DeleteCustomCategory extends Command
echo 'success:' . $item['id'] . PHP_EOL;
}catch (\Exception $e){
echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
errorLog('项目初始化失败', $item, $e);
errorLog('delete_custom_category删除失败', $item, $e);
}
}
return true;
... ...
... ... @@ -68,7 +68,7 @@ class DeleteNewsCategory extends Command
}
foreach ($list as $item){
echo 'start:' . $item['id'] . PHP_EOL;
// try {
try {
$projectModel = new Project();
$projectInfo = $projectModel->read(['id'=>$item['data']['project_id']]);
if($projectInfo === false){
... ... @@ -79,10 +79,10 @@ class DeleteNewsCategory extends Command
DB::disconnect('custom_mysql');
$noticeLogModel->edit(['status'=>NoticeLog::STATUS_SUCCESS],['id'=>$item['id']]);
echo 'success:' . $item['id'] . PHP_EOL;
// }catch (\Exception $e){
// echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
// errorLog('项目初始化失败', $item, $e);
// }
}catch (\Exception $e){
echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
errorLog('delete_news_category删除失败', $item, $e);
}
}
return true;
}
... ...
... ... @@ -82,7 +82,7 @@ class DeleteProductCategory extends Command
echo 'success:' . $item['id'] . PHP_EOL;
}catch (\Exception $e){
echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
errorLog('项目初始化失败', $item, $e);
errorLog('delete_product_category删除失败', $item, $e);
}
}
return true;
... ...
... ... @@ -72,7 +72,6 @@ class DomainInfo extends Command
'domain_start_time' => $time['start'],
'domain_end_time' => $time['end']
];
$domainModel->edit($data, ['id' => $v['id']]);
}
}
... ...
... ... @@ -47,8 +47,6 @@ class RemainDay extends Command
$list = Project::whereIn('type', [2,3,4])->get();
foreach ($list as $item){
if($item['type'] == Project::TYPE_TWO){
//排名达标天数
// $compliance_day = GoogleRankModel::where(['project_id' => $item['id'], 'lang' => ''])->value('compliance_day') ?: 0;
//获取当前项目的达标天数
$compliance_day = Project::where(['id' => $item['id']])->value('finish_remain_day') ?: 0;
$remain_day = $item['deploy_build']['service_duration'] - $compliance_day;
... ...
... ... @@ -62,6 +62,7 @@ class ServiceCount extends Command
}
$model->edit(['count'=>$count],['id'=>$v['id']]);
}
return true;
}
}
... ...
... ... @@ -73,8 +73,9 @@ class InquiryMonthlyCount extends Command
$arr['month'] = Carbon::now()->subMonth()->format('Y-m');
try {
DB::table('gl_month_count')->insert($arr);
Log::channel('month_count')->error('success:project_id .'.$arr['project_id']);
}catch (\Exception $e){
Log::channel('month_count')->error('month_count:失败 ' . $e->getMessage());
Log::channel('month_count')->error('month_count:error ' . $e->getMessage());
}
}
return true;
... ...