作者 李美松

数据推送代码调整

... ... @@ -37,6 +37,8 @@ class Kernel extends ConsoleKernel
$schedule->command('domain_info')->dailyAt('01:00')->withoutOverlapping(1);// 更新域名|证书结束时间,每天凌晨1点执行一次
$schedule->command('last_inquiry')->dailyAt('04:00')->withoutOverlapping(1);// 最近一次询盘信息
$schedule->command('update_progress')->everyThirtyMinutes()->withoutOverlapping(1);//监控更新
$schedule->command('website_data')->everyMinute()->withoutOverlapping(1); // 向AICC推送数据
$schedule->command('project_file_pdf')->everyMinute()->withoutOverlapping(1); // 网站项目数据,生成PDF文件
}
/**
... ...
... ... @@ -39,4 +39,23 @@ class AiccWechat extends Model
{
return self::query()->where('project_id', $project_id)->first();
}
/**
* @param int $page
* @param int $perPage
* @return array
*/
public function allData(int $page = 1, int $perPage = 15)
{
$status = 1; # 1 - 正常, 0 - 禁用
$lists = self::query()->where('status', $status)
->whereNotNull('project_id')
->whereNotNull('wx_user_id')
->paginate($perPage, ['project_id', 'wx_id', 'wx_user_id'], 'page', $page);
$items = $lists->Items();
$totalPage = $lists->lastPage();
$total = $lists->total();
$currentPage = $lists->currentPage();
return compact('total', 'items', 'totalPage', 'currentPage');
}
}
... ...
... ... @@ -343,7 +343,7 @@ Route::group([], function () {
Route::any('get_template_detail', [Aside\Template\ATemplateController::class, 'getTemplateDetail'])->name('admin.get_template_detail');
Route::any('/collect', [Aside\Collect\CollectController::class, 'index'])->name('admin.collect');
# AICC与V6.0数据推送 page - 分页 perPage - 分页数量
# AICC与V6.0数据推送
Route::get('/data_push', [\App\Http\Controllers\Bside\Aicc\AiccWeChatController::class, 'dataPush'])->name('admin.dataPush');
});
... ...