mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
commit
05709eb4de
@ -142,7 +142,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
}
|
||||
|
||||
if ($this->model->is_enabled('customfields')) {
|
||||
$query = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->filterSearch($customParameters, $query);
|
||||
$query = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->filterSearch($customParameters, $param, $query);
|
||||
}
|
||||
|
||||
|
||||
@ -160,29 +160,6 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
$query = $query->whereRaw($column);
|
||||
}
|
||||
|
||||
foreach ($param as $para => $value) {
|
||||
if (substr($para, 4, 3) === "cf_") {
|
||||
$id = substr($para, 7);
|
||||
$minmax = substr($para, 0, 3);
|
||||
if ($minmax == 'min') {
|
||||
|
||||
$num = $param[$minmax . '_cf_' . $id];
|
||||
$int = (int)$num;
|
||||
$column = "JSON_EXTRACT(cf_json, '$.cf" . $id . "') >= '" . $int . "'";
|
||||
$query = $query->whereRaw($column);
|
||||
|
||||
}
|
||||
if ($minmax == 'max') {
|
||||
|
||||
$num = $param[$minmax . '_cf_' . $id];
|
||||
$int = (int)$num;
|
||||
$column = "JSON_EXTRACT(cf_json, '$.cf" . $id . "') <= '" . $int . "'";
|
||||
$query = $query->whereRaw($column);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// //UPDATE `default_advs_advs` SET `coor` = (PointFromText('POINT(41.085022 28.804754)')) WHERE `default_advs_advs`.`id` = 8
|
||||
// //SELECT * FROM `default_advs_advs` WHERE ST_DISTANCE(ST_GeomFromText('POINT(41.0709052 28.829627)'), coor) < 20
|
||||
@ -199,10 +176,10 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
if (!empty($param['sort_by'])) {
|
||||
switch ($param['sort_by']) {
|
||||
case "sort_price_up":
|
||||
$query = $query->orderBy('price', 'desc');
|
||||
$query = $query->orderBy('advs_advs.price', 'desc');
|
||||
break;
|
||||
case "sort_price_down":
|
||||
$query = $query->orderBy('price', 'asc');
|
||||
$query = $query->orderBy('advs_advs.price', 'asc');
|
||||
break;
|
||||
case "sort_time":
|
||||
$query = $query->orderBy('advs_advs.created_at', 'desc');
|
||||
@ -210,12 +187,12 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
}
|
||||
} else {
|
||||
$query = $query->orderBy('advs_advs.created_at', 'desc');
|
||||
if ($isActiveDopings) {
|
||||
$query = app('Visiosoft\DopingsModule\Http\Controller\DopingsController')->querySelect($query, $param);
|
||||
} else {
|
||||
$query = $query->select('advs_advs.*', 'advs_advs_translations.name as name',
|
||||
'advs_advs_translations.advs_desc as advs_desc');
|
||||
}
|
||||
}
|
||||
if ($isActiveDopings) {
|
||||
$query = app('Visiosoft\DopingsModule\Http\Controller\DopingsController')->querySelect($query, $param);
|
||||
} else {
|
||||
$query = $query->select('advs_advs.*', 'advs_advs_translations.name as name',
|
||||
'advs_advs_translations.advs_desc as advs_desc');
|
||||
}
|
||||
|
||||
if ($type == "list") {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user