Compare commits
8 commits
master
...
more-conte
Author | SHA1 | Date | |
---|---|---|---|
|
f08049dc5c | ||
|
ecbd1c82cf | ||
|
4f49235511 | ||
|
179f9c9339 | ||
|
c003a6b23a | ||
|
aad314491b | ||
|
b9fe194dc8 | ||
|
15935ec109 |
1 changed files with 9 additions and 1 deletions
|
@ -219,7 +219,15 @@ class MainController extends AppController {
|
||||||
$moreClaims = [];
|
$moreClaims = [];
|
||||||
if (isset($claim->publisher) || $claim->claim_type == 1) {
|
if (isset($claim->publisher) || $claim->claim_type == 1) {
|
||||||
// find more claims for the publisher
|
// find more claims for the publisher
|
||||||
$moreClaims = $this->Claims->find()->select($this->Claims)->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)->order(['Claims.fee' => 'DESC', 'RAND()' => 'DESC'])->toArray();
|
$moreClaimsQuery = $this->Claims->find()->select([
|
||||||
|
'claim_id', 'bid_state', 'fee', 'fee_currency', 'is_nsfw', 'claim_type', 'name',
|
||||||
|
'title', 'description', 'content_type', 'language', 'author', 'license', 'content_type',
|
||||||
|
'created_at'
|
||||||
|
])->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 (isset($claim->publisher) && $claim->publisher_id !== 'f2cf43b86b9d70175dc22dbb9ff7806241d90780') { // prevent ORDER BY for this particular claim
|
||||||
|
$moreClaimsQuery = $moreClaimsQuery->order(['Claims.fee' => 'DESC', 'RAND()' => 'DESC']);
|
||||||
|
$moreClaims = $moreClaimsQuery->toArray();
|
||||||
|
}
|
||||||
for ($i = 0; $i < count($moreClaims); $i++) {
|
for ($i = 0; $i < count($moreClaims); $i++) {
|
||||||
if ($canConvert && $moreClaims[$i]->fee > 0 && $moreClaims[$i]->fee_currency == 'USD') {
|
if ($canConvert && $moreClaims[$i]->fee > 0 && $moreClaims[$i]->fee_currency == 'USD') {
|
||||||
$moreClaims[$i]->price = $moreClaims[$i]->fee / $priceInfo->price;
|
$moreClaims[$i]->price = $moreClaims[$i]->fee / $priceInfo->price;
|
||||||
|
|
Loading…
Reference in a new issue