partial update fix sync data pbg
This commit is contained in:
@@ -106,7 +106,7 @@ class ServicePbgTask
|
||||
};
|
||||
|
||||
do {
|
||||
$url = "{$this->simbg_host}/api/pbg/v1/list/?page={$currentPage}&size={$this->fetch_per_page}&sort=ASC";
|
||||
$url = "{$this->simbg_host}/api/pbg/v1/list/?page={$currentPage}&size={$this->fetch_per_page}&sort=ASC&date&search&status&slf_status&type&sort_by=created_at&application_type=1&start_date&end_date";
|
||||
|
||||
$fetch_data = $fetchData($url);
|
||||
if (!$fetch_data) {
|
||||
@@ -123,6 +123,8 @@ class ServicePbgTask
|
||||
$data = $response['data'];
|
||||
$totalPage = isset($response['total_page']) ? (int) $response['total_page'] : 1;
|
||||
|
||||
Log::info("Total data scraping {$totalPage}");
|
||||
|
||||
$saved_data = [];
|
||||
foreach ($data as $item) {
|
||||
$saved_data[] = [
|
||||
|
||||
@@ -55,7 +55,7 @@ class ServiceTabPbgTask
|
||||
try{
|
||||
$this->current_uuid = $pbg_task->uuid;
|
||||
$this->scraping_task_details($pbg_task->uuid);
|
||||
$this->scraping_task_assignments($pbg_task->uuid);
|
||||
// $this->scraping_task_assignments($pbg_task->uuid);
|
||||
$this->scraping_task_retributions($pbg_task->uuid);
|
||||
$this->scraping_task_integrations($pbg_task->uuid);
|
||||
}catch(\Exception $e){
|
||||
@@ -98,6 +98,8 @@ class ServiceTabPbgTask
|
||||
|
||||
$data = $responseData['data'];
|
||||
|
||||
Log::info("Executed uid : {$uuid}");
|
||||
|
||||
// Use the static method from PbgTaskDetail model to create/update
|
||||
PbgTaskDetail::createFromApiResponse($data, $uuid);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user