mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 15:26:10 -06:00
This commit is contained in:
parent
ac23a3e584
commit
9110db48e5
@ -190,15 +190,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
|||||||
|
|
||||||
|
|
||||||
if ($isActiveDopings) {
|
if ($isActiveDopings) {
|
||||||
if ($param == null) {
|
$query = app('Visiosoft\DopingsModule\Http\Controller\DopingsController')->search($query, $param);
|
||||||
$DopingModel = new DopingModel();
|
|
||||||
$doping_advs_ids = $DopingModel->getFeaturedAds(3);
|
|
||||||
$query = $query->whereIn('advs_advs.id', $doping_advs_ids);
|
|
||||||
}
|
|
||||||
$query = $query->leftJoin('dopings_dopings', function ($join) {
|
|
||||||
$join->on('advs_advs.id', '=', 'dopings_dopings.adv_name_id');
|
|
||||||
$join->where('dopings_dopings.doping_type_id', '=', 4);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if (!empty($param['sort_by'])) {
|
if (!empty($param['sort_by'])) {
|
||||||
switch ($param['sort_by']) {
|
switch ($param['sort_by']) {
|
||||||
@ -215,8 +207,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
|||||||
} else {
|
} else {
|
||||||
$query = $query->orderBy('advs_advs.created_at', 'desc');
|
$query = $query->orderBy('advs_advs.created_at', 'desc');
|
||||||
if ($isActiveDopings) {
|
if ($isActiveDopings) {
|
||||||
$query = $query->select('advs_advs.*', 'advs_advs_translations.name as name',
|
$query = app('Visiosoft\DopingsModule\Http\Controller\DopingsController')->querySelect($query);
|
||||||
'advs_advs_translations.advs_desc as advs_desc', 'dopings_dopings.id as doping');
|
|
||||||
} else {
|
} else {
|
||||||
$query = $query->select('advs_advs.*', 'advs_advs_translations.name as name',
|
$query = $query->select('advs_advs.*', 'advs_advs_translations.name as name',
|
||||||
'advs_advs_translations.advs_desc as advs_desc');
|
'advs_advs_translations.advs_desc as advs_desc');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user