mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 23:06:08 -06:00
Merge pull request #548 from openclassify/vedat
#1339 remove ad limit for core
This commit is contained in:
commit
478b5f39ef
@ -23,7 +23,6 @@ return [
|
|||||||
'auto_approve',
|
'auto_approve',
|
||||||
'estimated_pending_time',
|
'estimated_pending_time',
|
||||||
'default_published_time',
|
'default_published_time',
|
||||||
'default_adv_limit',
|
|
||||||
'default_GET',
|
'default_GET',
|
||||||
'thumbnail_width',
|
'thumbnail_width',
|
||||||
'thumbnail_height',
|
'thumbnail_height',
|
||||||
|
|||||||
@ -50,15 +50,6 @@ return [
|
|||||||
'default_value' => 10,
|
'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' => [
|
'iban_numbers' => [
|
||||||
'type' => 'anomaly.field_type.wysiwyg',
|
'type' => 'anomaly.field_type.wysiwyg',
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'error_added_cart' => 'Requested product is currently missing or inactive',
|
'error_added_cart' => 'Requested product is currently missing or inactive',
|
||||||
'please_buy_package' => 'Please buy package',
|
|
||||||
'please_payment' => 'Please Pay',
|
'please_payment' => 'Please Pay',
|
||||||
'bank_account_info' => 'Bank account information',
|
'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.',
|
'agreement' => 'By clicking Post, you agree to our Terms of Use and Privacy Policy acknowledge that you are the rightful owner of this item.',
|
||||||
|
|||||||
@ -18,9 +18,6 @@ return [
|
|||||||
'default_published_time' => [
|
'default_published_time' => [
|
||||||
'name' => 'Default Publish Time',
|
'name' => 'Default Publish Time',
|
||||||
],
|
],
|
||||||
'default_adv_limit' => [
|
|
||||||
'name' => 'Default Ads Limit',
|
|
||||||
],
|
|
||||||
'address' => [
|
'address' => [
|
||||||
'name' => 'Contact Adress',
|
'name' => 'Contact Adress',
|
||||||
],
|
],
|
||||||
|
|||||||
@ -18,9 +18,6 @@ return [
|
|||||||
'default_published_time' => [
|
'default_published_time' => [
|
||||||
'name' => 'Varsayılan Yayın Süresi',
|
'name' => 'Varsayılan Yayın Süresi',
|
||||||
],
|
],
|
||||||
'default_adv_limit' => [
|
|
||||||
'name' => 'Varsayılan İlan Sınırı',
|
|
||||||
],
|
|
||||||
'address' => [
|
'address' => [
|
||||||
'name' => 'İletişim Adresiniz',
|
'name' => 'İletişim Adresiniz',
|
||||||
],
|
],
|
||||||
|
|||||||
@ -469,24 +469,14 @@ class AdvsController extends PublicController
|
|||||||
|
|
||||||
public function getCatsForNewAd($id)
|
public function getCatsForNewAd($id)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if ($this->adv_model->is_enabled('packages')) {
|
||||||
|
$cats = app('Visiosoft\PackagesModule\Http\Controller\PackageFEController')->AdLimitForCategorySelection($id);
|
||||||
|
} else {
|
||||||
$cats = $this->getCats($id);
|
$cats = $this->getCats($id);
|
||||||
$count_user_ads = count($this->adv_model->userAdv()->get());
|
|
||||||
|
|
||||||
if (empty($cats->toArray())) {
|
if (empty($cats->toArray())) {
|
||||||
$cats = trans('visiosoft.module.advs::message.create_ad_with_post_cat');
|
$cats = trans('visiosoft.module.advs::message.create_ad_with_post_cat');
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $cats;
|
return $cats;
|
||||||
@ -547,19 +537,10 @@ class AdvsController extends PublicController
|
|||||||
/* Update Adv */
|
/* Update Adv */
|
||||||
$adv = AdvsAdvsEntryModel::find($request->update_id);
|
$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 == "") {
|
if ($advModel->is_enabled('packages') and $adv->slug == "") {
|
||||||
$parent_cat = $categoryModel->getParentCats($request->cat1, 'parent_id');
|
$cat = app('Visiosoft\PackagesModule\Http\Controller\PackageFEController')->AdLimitForNewAd($request);
|
||||||
$packageModel = new PackageModel();
|
if(!is_null($cat))
|
||||||
$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('/');
|
return redirect('/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user