mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#1339 remove ad limit for core
This commit is contained in:
parent
e805752488
commit
aca805c0fe
@ -23,7 +23,6 @@ return [
|
||||
'auto_approve',
|
||||
'estimated_pending_time',
|
||||
'default_published_time',
|
||||
'default_adv_limit',
|
||||
'default_GET',
|
||||
'thumbnail_width',
|
||||
'thumbnail_height',
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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.',
|
||||
|
||||
@ -18,9 +18,6 @@ return [
|
||||
'default_published_time' => [
|
||||
'name' => 'Default Publish Time',
|
||||
],
|
||||
'default_adv_limit' => [
|
||||
'name' => 'Default Ads Limit',
|
||||
],
|
||||
'address' => [
|
||||
'name' => 'Contact Adress',
|
||||
],
|
||||
|
||||
@ -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',
|
||||
],
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user