mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 07:16:06 -06:00
Merge branches 'fatihalp' and 'master' of https://github.com/openclassify/openclassify into fatihalp
Conflicts: addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php
This commit is contained in:
commit
ab92313c4c
@ -109,7 +109,7 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
|||||||
->where('advs_advs.finish_at', '>', date('Y-m-d H:i:s'));
|
->where('advs_advs.finish_at', '>', date('Y-m-d H:i:s'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function foreignCurrency($currency, $price, $isUpdate, $settings)
|
public function foreignCurrency($currency, $price, $isUpdate, $settings, $showMsg = true)
|
||||||
{
|
{
|
||||||
$currencies = setting_value('visiosoft.module.advs::enabled_currencies');
|
$currencies = setting_value('visiosoft.module.advs::enabled_currencies');
|
||||||
$messages = app(MessageBag::class);
|
$messages = app(MessageBag::class);
|
||||||
@ -141,7 +141,9 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
|||||||
$response = $e->getResponse();
|
$response = $e->getResponse();
|
||||||
$responseBodyAsString = $response->getBody()->getContents();
|
$responseBodyAsString = $response->getBody()->getContents();
|
||||||
$response = json_decode($responseBodyAsString, true);
|
$response = json_decode($responseBodyAsString, true);
|
||||||
$messages->error($response['error']);
|
if ($showMsg) {
|
||||||
|
$messages->error($response['error']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ interface AdvInterface extends EntryInterface
|
|||||||
|
|
||||||
public function myAdvsByUser();
|
public function myAdvsByUser();
|
||||||
|
|
||||||
public function foreignCurrency($currency, $price, $isUpdate, $settings);
|
public function foreignCurrency($currency, $price, $isUpdate, $settings, $showMsg);
|
||||||
|
|
||||||
public function popularAdvs();
|
public function popularAdvs();
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ use Anomaly\Streams\Platform\Http\Controller\PublicController;
|
|||||||
use Anomaly\Streams\Platform\Message\MessageBag;
|
use Anomaly\Streams\Platform\Message\MessageBag;
|
||||||
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
|
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
|
||||||
use Anomaly\Streams\Platform\Model\Complaints\ComplaintsComplainTypesEntryModel;
|
use Anomaly\Streams\Platform\Model\Complaints\ComplaintsComplainTypesEntryModel;
|
||||||
|
use Anomaly\Streams\Platform\Support\Currency;
|
||||||
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
|
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@ -868,6 +869,7 @@ class AdvsController extends PublicController
|
|||||||
if ($is_new_create) {
|
if ($is_new_create) {
|
||||||
event(new CreatedAd($adv));
|
event(new CreatedAd($adv));
|
||||||
} else {
|
} else {
|
||||||
|
$this->adv_model->foreignCurrency($request->currency, $request->price, $request->update_id, $this->settings_repository, false);
|
||||||
event(new EditedAd($before_editing, $adv));
|
event(new EditedAd($before_editing, $adv));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user