From b9fe194dc8b4139f599a25e0f50114e877d8e493 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Wed, 28 Oct 2020 15:37:39 +0100 Subject: [PATCH] check publisher claim_id --- src/Controller/MainController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 15a6515..614f710 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -224,7 +224,7 @@ class MainController extends AppController { 'name', 'title', 'description', 'content_type', 'language', 'author', 'license', 'content_type' ])->select(['publisher' => 'C.name'])->leftJoin(['C' => 'claim'], ['C.claim_id = Claims.publisher_id'])->where(['Claims.claim_type' => 1, 'Claims.id <>' => $claim->id, 'Claims.publisher_id' => isset($claim->publisher) ? $claim->publisher_id : $claim->claim_id])->limit(9); - if ($id !== 'f2cf43b86b9d70175dc22dbb9ff7806241d90780') { // prevent ORDER BY for this particular claim + if ($claim->publisher->claim_id !== 'f2cf43b86b9d70175dc22dbb9ff7806241d90780') { // prevent ORDER BY for this particular claim $moreClaimsQuery = $moreClaimsQuery->order(['Claims.fee' => 'DESC', 'RAND()' => 'DESC']); } $moreClaims = $moreClaimsQuery->toArray();