Merge pull request #839 from openclassify/dia

#2773 emlak24 edit all area
This commit is contained in:
Fatih Alp 2020-11-30 17:50:18 +03:00 committed by GitHub
commit e9deba945c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -27,4 +27,6 @@ return [
'ad_doesnt_exist' => "This ad doesn't exist!",
'select_location_error' => "Please select a location on the map!",
'this_ad_is_not_valid_anymore' => "This ad is not valid anymore!",
'approve_status_change' => "Your Ad's Status Has Been Set to Active!",
'passive_status_change' => "Your Ad's Status Has Been Set to Passive!",
];

View File

@ -484,7 +484,7 @@ class AdvsController extends PublicController
$adv = $this->adv_repository->getListItemAdv($id);
if ($adv && (!$adv->expired() || $adv->created_by_id === \auth()->id())) {
if ($adv && ((!$adv->expired() && $adv->getStatus() === 'approved') || $adv->created_by_id === \auth()->id())) {
// Check if created by exists
if (!$adv->created_by) {
$this->messages->error('visiosoft.module.advs::message.this_ad_is_not_valid_anymore');
@ -980,7 +980,10 @@ class AdvsController extends PublicController
$this->adv_model->statusAds($id, $type);
event(new ChangedStatusAd($ad));//Create Notify
$this->messages->success(trans('streams::message.edit_success', ['name' => trans('visiosoft.module.advs::field.status.name')]));
$message = $type === 'approved' ?
trans('visiosoft.module.advs::message.approve_status_change')
: trans('visiosoft.module.advs::message.passive_status_change');
$this->messages->success($message);
return back();
}