#1339 remove ad limit for core

This commit is contained in:
vedat@vebze.com 2020-05-11 13:28:53 +03:00
parent e805752488
commit aca805c0fe
6 changed files with 12 additions and 48 deletions

View File

@ -23,7 +23,6 @@ return [
'auto_approve',
'estimated_pending_time',
'default_published_time',
'default_adv_limit',
'default_GET',
'thumbnail_width',
'thumbnail_height',

View File

@ -50,15 +50,6 @@ return [
'default_value' => 10,
],
],
'default_adv_limit' => [
'type' => 'anomaly.field_type.integer',
'bind' => 'adv.default_adv_limit',
'env' => 'ADV_LIMIT',
'required' => true,
'config' => [
'default_value' => 15,
],
],
'iban_numbers' => [
'type' => 'anomaly.field_type.wysiwyg',

View File

@ -2,7 +2,6 @@
return [
'error_added_cart' => 'Requested product is currently missing or inactive',
'please_buy_package' => 'Please buy package',
'please_payment' => 'Please Pay',
'bank_account_info' => 'Bank account information',
'agreement' => 'By clicking Post, you agree to our Terms of Use and Privacy Policy acknowledge that you are the rightful owner of this item.',

View File

@ -18,9 +18,6 @@ return [
'default_published_time' => [
'name' => 'Default Publish Time',
],
'default_adv_limit' => [
'name' => 'Default Ads Limit',
],
'address' => [
'name' => 'Contact Adress',
],

View File

@ -18,9 +18,6 @@ return [
'default_published_time' => [
'name' => 'Varsayılan Yayın Süresi',
],
'default_adv_limit' => [
'name' => 'Varsayılan İlan Sınırı',
],
'address' => [
'name' => 'İletişim Adresiniz',
],

View File

@ -469,24 +469,14 @@ class AdvsController extends PublicController
public function getCatsForNewAd($id)
{
$cats = $this->getCats($id);
$count_user_ads = count($this->adv_model->userAdv()->get());
if (empty($cats->toArray())) {
$cats = trans('visiosoft.module.advs::message.create_ad_with_post_cat');
if ($this->adv_model->is_enabled('packages')) {
$cats = app('Visiosoft\PackagesModule\Http\Controller\PackageFEController')->AdLimitForCategorySelection($id);
} else {
$cats = $this->getCats($id);
if (setting_value('visiosoft.module.advs::default_adv_limit') <= $count_user_ads) {
if ($this->adv_model->is_enabled('packages')) {
$packageModel = new PackageModel();
$parent_cat = $this->category_model->getParentCats($id, 'parent_id');
$package = $packageModel->reduceLimit($parent_cat);
if ($package != null) {
return $package;
}
} else {
$msg = trans('visiosoft.module.advs::message.max_ad_limit');
return $msg;
}
if (empty($cats->toArray())) {
$cats = trans('visiosoft.module.advs::message.create_ad_with_post_cat');
}
}
return $cats;
@ -547,21 +537,12 @@ class AdvsController extends PublicController
/* Update Adv */
$adv = AdvsAdvsEntryModel::find($request->update_id);
$count_user_ads = count($this->adv_model->userAdv()->get());
if (setting_value('visiosoft.module.advs::default_adv_limit') < $count_user_ads) {
if ($advModel->is_enabled('packages') and $adv->slug == "") {
$parent_cat = $categoryModel->getParentCats($request->cat1, 'parent_id');
$packageModel = new PackageModel();
$package = $packageModel->reduceLimit($parent_cat, 'reduce');
if ($package != null) {
$this->messages->error(trans('visiosoft.module.advs::message.please_buy_package'));
return redirect('/');
}
} elseif ($adv->slug == '') {
$this->messages->error(trans('visiosoft.module.advs::message.max_ad_limit.title'));
return redirect('/');
}
if ($advModel->is_enabled('packages') and $adv->slug == "") {
$cat = app('Visiosoft\PackagesModule\Http\Controller\PackageFEController')->AdLimitForNewAd($request);
if(!is_null($cat))
{
return redirect('/');
}
}
$adv->is_get_adv = $request->is_get_adv;