This commit is contained in:
@ -383,12 +383,16 @@ function qdb_recompute_profile_scores_for_client(PDO $pdo, string $clientCode, ?
|
||||
$upsert = $pdo->prepare(
|
||||
'INSERT INTO client_scoring_profile_result
|
||||
(clientCode, profileID, weightedTotal, band, computedAt, questionnaireSnapshot)
|
||||
VALUES (:cc, :pid, :wt, :band, :at, :snap)
|
||||
ON CONFLICT(clientCode, profileID) DO UPDATE SET
|
||||
weightedTotal = excluded.weightedTotal,
|
||||
band = excluded.band,
|
||||
computedAt = excluded.computedAt,
|
||||
questionnaireSnapshot = excluded.questionnaireSnapshot'
|
||||
VALUES (:cc, :pid, :wt, :band, :at, :snap) '
|
||||
. qdb_upsert_update(
|
||||
['clientCode', 'profileID'],
|
||||
[
|
||||
'weightedTotal' => 'excluded.weightedTotal',
|
||||
'band' => 'excluded.band',
|
||||
'computedAt' => 'excluded.computedAt',
|
||||
'questionnaireSnapshot' => 'excluded.questionnaireSnapshot',
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
foreach ($profiles as $profile) {
|
||||
|
||||
Reference in New Issue
Block a user