diff --git a/app/Console/Commands/Zq/SyncCtzq.php b/app/Console/Commands/Zq/SyncCtzq.php index b8c2e9e9..9d14bc0a 100755 --- a/app/Console/Commands/Zq/SyncCtzq.php +++ b/app/Console/Commands/Zq/SyncCtzq.php @@ -101,7 +101,8 @@ class SyncCtzq extends Command if (!$matches) { return; } - + $matchIds = array_column($matches, 'matchId'); + CtzqJqcMatch::where('ctzq_jqc_id', $ctzq->id)->whereNotIn('match_id', $matchIds)->delete(); foreach ($matches as $item) { $match = CtzqJqcMatch::where('ctzq_jqc_id', $ctzq->id)->where('match_id', $item['matchId'])->first(); if (!$match) { @@ -163,7 +164,8 @@ class SyncCtzq extends Command if (!$matches) { return; } - + $matchIds = array_column($matches, 'matchId'); + CtzqBqcMatch::where('ctzq_bqc_id', $ctzq->id)->whereNotIn('match_id', $matchIds)->delete(); foreach ($matches as $item) { $match = CtzqBqcMatch::where('ctzq_bqc_id', $ctzq->id)->where('match_id', $item['matchId'])->first(); if (!$match) { @@ -234,7 +236,8 @@ class SyncCtzq extends Command if (!$matches) { return; } - + $matchIds = array_column($matches, 'matchId'); + CtzqSfcMatch::where('ctzq_sfc_id', $ctzqSfc->id)->whereNotIn('match_id', $matchIds)->delete(); foreach ($matches as $item) { $match = CtzqSfcMatch::where('ctzq_sfc_id', $ctzqSfc->id)->where('match_id', $item['matchId'])->first(); if (!$match) {