mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 14:56:13 -06:00
Merge pull request #975 from openclassify/vedatakdn
fixed location filter
This commit is contained in:
commit
c6cc88eaca
@ -67,7 +67,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!setting_value('visiosoft.module.location::hide_location_filter') and isset($param['country'])) {
|
if (!setting_value('visiosoft.module.location::hide_location_filter')) {
|
||||||
$country = !empty($param['country']) ? $param['country'] : setting_value('visiosoft.module.location::default_country');
|
$country = !empty($param['country']) ? $param['country'] : setting_value('visiosoft.module.location::default_country');
|
||||||
if ($country) {
|
if ($country) {
|
||||||
$query = $query->where('country_id', $country);
|
$query = $query->where('country_id', $country);
|
||||||
|
|||||||
@ -483,9 +483,9 @@ class AdvsController extends PublicController
|
|||||||
$adv = $this->adv_repository->getListItemAdv($id);
|
$adv = $this->adv_repository->getListItemAdv($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($adv && ((!$adv->expired() && $adv->getStatus() === 'approved') || $adv->created_by_id === \auth()->id())) {
|
if ((auth()->user() and auth()->user()->hasRole('admin')) or ($adv && ((!$adv->expired() && $adv->getStatus() === 'approved') || $adv->created_by_id === \auth()->id()))) {
|
||||||
// Check if created by exists
|
// Check if created by exists
|
||||||
if (!$adv->created_by) {
|
if ((auth()->user() and !auth()->user()->hasRole('admin')) and !$adv->created_by) {
|
||||||
$this->messages->error('visiosoft.module.advs::message.this_ad_is_not_valid_anymore');
|
$this->messages->error('visiosoft.module.advs::message.this_ad_is_not_valid_anymore');
|
||||||
return $this->redirect->route('visiosoft.module.advs::list');
|
return $this->redirect->route('visiosoft.module.advs::list');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,9 +18,10 @@ class UsersController extends AdminController
|
|||||||
$term = request()->term;
|
$term = request()->term;
|
||||||
if ($term) {
|
if ($term) {
|
||||||
return $userRepository->newQuery()
|
return $userRepository->newQuery()
|
||||||
->select(DB::raw("CONCAT_WS('', first_name, ' ', last_name, ' (', gsm_phone, ' || ', email, ')') AS name"), 'id')
|
->select(DB::raw("CONCAT_WS('', first_name, ' ', last_name, ' (', gsm_phone, ' || ', display_name, ' || ', email, ')') AS name"), 'id')
|
||||||
->where('first_name', 'LIKE', "%$term%")
|
->where('first_name', 'LIKE', "%$term%")
|
||||||
->orWhere('last_name', 'LIKE', "%$term%")
|
->orWhere('last_name', 'LIKE', "%$term%")
|
||||||
|
->orWhere('display_name', 'LIKE', "%$term%")
|
||||||
->orWhere('gsm_phone', 'LIKE', "%$term%")
|
->orWhere('gsm_phone', 'LIKE', "%$term%")
|
||||||
->limit(setting_value('visiosoft.module.advs::user_filter_limit'))
|
->limit(setting_value('visiosoft.module.advs::user_filter_limit'))
|
||||||
->pluck('name', 'id');
|
->pluck('name', 'id');
|
||||||
|
|||||||
@ -68,6 +68,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
|||||||
'profile/class/extendTime/{id},{type}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@extendAds',
|
'profile/class/extendTime/{id},{type}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@extendAds',
|
||||||
'profile/message/show/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@showMessage',
|
'profile/message/show/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@showMessage',
|
||||||
'profile/close-account' => [
|
'profile/close-account' => [
|
||||||
|
'middleware' => 'auth',
|
||||||
'as' => 'visiosoft.module.profile::profile_close_account',
|
'as' => 'visiosoft.module.profile::profile_close_account',
|
||||||
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@disableAccount'
|
'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@disableAccount'
|
||||||
],
|
],
|
||||||
|
|||||||
@ -9,12 +9,14 @@ SET time_zone = "+00:00";
|
|||||||
/*!40101 SET NAMES utf8mb4 */;
|
/*!40101 SET NAMES utf8mb4 */;
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `default_settings_settings` (`id`, `sort_order`, `created_at`, `created_by_id`, `updated_at`, `updated_by_id`, `key`, `value`) VALUES
|
INSERT INTO `default_settings_settings` (`created_at`,`key`, `value`) VALUES
|
||||||
(7, 7, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::date_format', 'j F, Y'),
|
('2019-07-15 06:48:46', 'streams::date_format', 'j F, Y'),
|
||||||
(8, 8, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::time_format', 'H:i'),
|
('2019-07-15 06:48:46', 'streams::time_format', 'H:i'),
|
||||||
(11, 11, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::standard_theme', 'visiosoft.theme.base'),
|
('2019-07-15 06:48:46', 'streams::name', 'PHP Classifieds software'),
|
||||||
(12, 12, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::admin_theme', 'visiosoft.theme.defaultadmin'),
|
('2019-07-15 06:48:46', 'streams::description', 'OpenClassify is modular and most advanced open source classified platform build with Laravel.Use it in real estate classifieds, auto, e-commerce and other ...'),
|
||||||
(15, 15, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::enabled_locales', 'a:11:{i:0;s:2:\"en\";i:1;s:2:\"fa\";i:2;s:2:\"ar\";i:3;s:2:\"el\";i:4;s:2:\"es\";i:5;s:2:\"fr\";i:6;s:2:\"it\";i:7;s:2:\"nl\";i:8;s:2:\"pt\";i:9;s:2:\"ru\";i:10;s:2:\"tr\";}');
|
('2019-07-15 06:48:46', 'streams::standard_theme', 'visiosoft.theme.base'),
|
||||||
|
('2019-07-15 06:48:46', 'streams::admin_theme', 'visiosoft.theme.defaultadmin'),
|
||||||
|
('2019-07-15 06:48:46', 'streams::enabled_locales', 'a:11:{i:0;s:2:\"en\";i:1;s:2:\"fa\";i:2;s:2:\"ar\";i:3;s:2:\"el\";i:4;s:2:\"es\";i:5;s:2:\"fr\";i:6;s:2:\"it\";i:7;s:2:\"nl\";i:8;s:2:\"pt\";i:9;s:2:\"ru\";i:10;s:2:\"tr\";}');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user