diff --git a/addons/default/visiosoft/location-module/migrations/2018_09_25_211014_visiosoft.module.location__create_location_fields.php b/addons/default/visiosoft/location-module/migrations/2018_09_25_211014_visiosoft.module.location__create_location_fields.php index 4bfed624d..2a73d4360 100644 --- a/addons/default/visiosoft/location-module/migrations/2018_09_25_211014_visiosoft.module.location__create_location_fields.php +++ b/addons/default/visiosoft/location-module/migrations/2018_09_25_211014_visiosoft.module.location__create_location_fields.php @@ -28,186 +28,31 @@ class VisiosoftModuleLocationCreateLocationFields extends Migration ], ], 'description' => 'anomaly.field_type.textarea', - 'advs_desc' => [ - 'type' => 'anomaly.field_type.wysiwyg', - 'config' => [ - 'height' => 500, - ], - ], - 'cat1' => [ - 'type' => 'anomaly.field_type.select', - 'config' => [ - "default_value" => 0, - ] - ], - 'cat2' => [ - 'type' => 'anomaly.field_type.select', - 'config' => [ - "default_value" => NULL, - ] - ], - 'cat3' => [ - 'type' => 'anomaly.field_type.select', - 'config' => [ - "default_value" => NULL, - ] - ], - 'cat4' => [ - 'type' => 'anomaly.field_type.select', - 'config' => [ - "default_value" => NULL, - ] - ], - 'cat5' => [ - 'type' => 'anomaly.field_type.select', - 'config' => [ - "default_value" => NULL, - ] - ], - 'cat6' => [ - 'type' => 'anomaly.field_type.select', - 'config' => [ - "default_value" => NULL, - ] - ], - 'cat7' => [ - 'type' => 'anomaly.field_type.select', - 'config' => [ - "default_value" => NULL, - ] - ], - 'parent_category' => [ - 'type' => 'anomaly.field_type.relationship', - 'config' => [ - 'related' => CategoryModel::class, - "default_value" => 0, - ] - ], - 'status' => [ - 'type' => 'anomaly.field_type.text', - 'config' => [ - 'type' => 'text', - 'default_value' => 'pending_user' - ] - ], - 'order' => 'anomaly.field_type.integer', - 'price' => 'anomaly.field_type.decimal', - 'currency' => [ - 'type' => 'anomaly.field_type.select', - 'config' => [ - 'handler' => 'currencies', - ], - ], - 'stock' => 'anomaly.field_type.integer', - 'online_payment' => [ - 'type' => 'anomaly.field_type.boolean', - 'config' => [ - 'default_value' => 0, - ] - ], - 'is_get_adv' => [ - 'type' => 'anomaly.field_type.boolean', - 'config' => [ - 'default_value' => 0, - ] - ], - 'files' => [ - 'type' => 'visiosoft.field_type.media', - 'config' => [ - 'folders' => ["images"], - 'mode' => 'upload', - ] - ], - 'country' => [ + 'parent_country' => [ 'type' => 'anomaly.field_type.relationship', 'config' => [ 'related' => CountryModel::class, "default_value" => 0, ] ], - 'city' => [ + 'parent_city' => [ "type" => "anomaly.field_type.select", "config" => [ "options" => [], ] ], - 'district' => [ + 'parent_district' => [ "type" => "anomaly.field_type.select", "config" => [ "options" => [], ] ], - 'neighborhood' => [ + 'parent_neighborhood' => [ "type" => "anomaly.field_type.select", "config" => [ "options" => [], ] ], - 'village' => [ - "type" => "anomaly.field_type.select", - "config" => [ - "options" => [], - ] - ], - 'map_Val' => "anomaly.field_type.text", - 'parent_country_id' => 'anomaly.field_type.integer', - 'parent_city_id' => 'anomaly.field_type.integer', - 'parent_district_id' => 'anomaly.field_type.integer', - 'parent_neighborhood_id' => 'anomaly.field_type.integer', - 'publish_at' => 'anomaly.field_type.datetime', - 'finish_at' => 'anomaly.field_type.datetime', - 'custom_field_category' => [ - 'type' => 'anomaly.field_type.relationship', - 'config' => [ - 'related' => CustomFieldModel::class, - ], - ], - 'parent_adv' => [ - 'type' => 'anomaly.field_type.relationship', - 'config' => [ - 'related' => AdvModel::class, - ], - ], - 'custom_field_value' => 'anomaly.field_type.text', - 'type' => [ - 'type' => 'anomaly.field_type.select', - 'config' => [ - 'options' => ['text' => 'Text Box', 'select' => 'Secim Alani(Select Box)', 'checkboxes' => 'Coklu Secim(Check Box)', 'multiple' => 'Cok Satirli Alan(Multi Line Box)', 'integer' => 'Tam Sayi', 'colorpicker' => 'Color Picker'], - 'separator' => ':', - ] - ], - 'custom_field_select_options' => 'anomaly.field_type.text', - 'popular_adv' => [ - 'type' => 'anomaly.field_type.boolean', - 'config' => [ - 'default_value' => 0, - ] - ], - 'adv_day' => [ - 'type' => 'anomaly.field_type.boolean', - 'config' => [ - 'default_value' => 0, - ] - ], - 'custom_field_type' => "anomaly.field_type.text", - 'cf_json' => "visiosoft.field_type.json", - 'foreign_currencies' => 'visiosoft.field_type.json', - 'deleted_at' => "anomaly.field_type.datetime", - 'value' => 'anomaly.field_type.text', - 'cover_photo' => 'anomaly.field_type.text', - 'category_id' => 'anomaly.field_type.integer', - 'field_id' => 'anomaly.field_type.integer', - 'custom_field' => [ - 'type' => 'anomaly.field_type.relationship', - 'config' => [ - 'related' => CustomFieldModel::class, - ], - ], - 'count_show_phone' => [ - 'type' => 'anomaly.field_type.integer', - 'config' => [ - 'default_value' => 0, - ] - ], + 'order' => 'anomaly.field_type.integer', ]; } diff --git a/addons/default/visiosoft/location-module/migrations/2018_10_11_043036_visiosoft.module.location__create_cities_stream.php b/addons/default/visiosoft/location-module/migrations/2018_10_11_043036_visiosoft.module.location__create_cities_stream.php index 3e2e1d313..4c64234cd 100644 --- a/addons/default/visiosoft/location-module/migrations/2018_10_11_043036_visiosoft.module.location__create_cities_stream.php +++ b/addons/default/visiosoft/location-module/migrations/2018_10_11_043036_visiosoft.module.location__create_cities_stream.php @@ -33,7 +33,7 @@ class VisiosoftModuleLocationCreateCitiesStream extends Migration 'unique' => true, 'required' => true, ], - 'parent_country_id' => [ + 'parent_country' => [ 'required' => true, ], 'order' diff --git a/addons/default/visiosoft/location-module/migrations/2018_10_11_043108_visiosoft.module.location__create_districts_stream.php b/addons/default/visiosoft/location-module/migrations/2018_10_11_043108_visiosoft.module.location__create_districts_stream.php index 4ccb2922a..6148a8be7 100644 --- a/addons/default/visiosoft/location-module/migrations/2018_10_11_043108_visiosoft.module.location__create_districts_stream.php +++ b/addons/default/visiosoft/location-module/migrations/2018_10_11_043108_visiosoft.module.location__create_districts_stream.php @@ -33,7 +33,7 @@ class VisiosoftModuleLocationCreateDistrictsStream extends Migration 'unique' => true, 'required' => true, ], - 'parent_city_id' => [ + 'parent_city' => [ 'required' => true, ], 'order' diff --git a/addons/default/visiosoft/location-module/migrations/2018_10_11_043124_visiosoft.module.location__create_neighborhoods_stream.php b/addons/default/visiosoft/location-module/migrations/2018_10_11_043124_visiosoft.module.location__create_neighborhoods_stream.php index 3238f3959..17a929df8 100644 --- a/addons/default/visiosoft/location-module/migrations/2018_10_11_043124_visiosoft.module.location__create_neighborhoods_stream.php +++ b/addons/default/visiosoft/location-module/migrations/2018_10_11_043124_visiosoft.module.location__create_neighborhoods_stream.php @@ -33,7 +33,7 @@ class VisiosoftModuleLocationCreateNeighborhoodsStream extends Migration 'unique' => true, 'required' => true, ], - 'parent_district_id' => [ + 'parent_district' => [ 'required' => true, ], 'order' diff --git a/addons/default/visiosoft/location-module/migrations/2018_10_16_112447_visiosoft.module.location__create_village_stream.php b/addons/default/visiosoft/location-module/migrations/2018_10_16_112447_visiosoft.module.location__create_village_stream.php index 60ad2d598..b34dc55f5 100644 --- a/addons/default/visiosoft/location-module/migrations/2018_10_16_112447_visiosoft.module.location__create_village_stream.php +++ b/addons/default/visiosoft/location-module/migrations/2018_10_16_112447_visiosoft.module.location__create_village_stream.php @@ -33,7 +33,7 @@ class VisiosoftModuleLocationCreateVillageStream extends Migration 'unique' => true, 'required' => true, ], - 'parent_neighborhood_id' => [ + 'parent_neighborhood' => [ 'required' => true, ], 'order' diff --git a/addons/default/visiosoft/location-module/src/City/Table/CityTableBuilder.php b/addons/default/visiosoft/location-module/src/City/Table/CityTableBuilder.php index 87fc3b03f..86dd6a93b 100644 --- a/addons/default/visiosoft/location-module/src/City/Table/CityTableBuilder.php +++ b/addons/default/visiosoft/location-module/src/City/Table/CityTableBuilder.php @@ -61,7 +61,7 @@ class CityTableBuilder extends TableBuilder */ protected $options = [ 'order_by' => [ - 'id' => 'DESC', + 'sort_order' => 'ASC', ], ]; diff --git a/addons/default/visiosoft/location-module/src/Country/Table/CountryTableBuilder.php b/addons/default/visiosoft/location-module/src/Country/Table/CountryTableBuilder.php index 15bd398ee..08f21241b 100644 --- a/addons/default/visiosoft/location-module/src/Country/Table/CountryTableBuilder.php +++ b/addons/default/visiosoft/location-module/src/Country/Table/CountryTableBuilder.php @@ -61,7 +61,7 @@ class CountryTableBuilder extends TableBuilder */ protected $options = [ 'order_by' => [ - 'id' => 'DESC', + 'sort_order' => 'ASC', ], ]; diff --git a/addons/default/visiosoft/location-module/src/District/Table/DistrictTableBuilder.php b/addons/default/visiosoft/location-module/src/District/Table/DistrictTableBuilder.php index 5163c9f13..291429ad6 100644 --- a/addons/default/visiosoft/location-module/src/District/Table/DistrictTableBuilder.php +++ b/addons/default/visiosoft/location-module/src/District/Table/DistrictTableBuilder.php @@ -61,7 +61,7 @@ class DistrictTableBuilder extends TableBuilder */ protected $options = [ 'order_by' => [ - 'id' => 'DESC', + 'sort_order' => 'ASC', ], ]; diff --git a/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php b/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php index 396af406e..88012e68f 100644 --- a/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php +++ b/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php @@ -57,7 +57,7 @@ class AjaxController extends PublicController if ($this->request->id) return $this->country_model->find($this->request->id); else - return $this->country_model->get(); + return $this->country_model->orderBy('order', 'ASC')->get(); } /** @@ -67,7 +67,7 @@ class AjaxController extends PublicController { if ($this->request->id) { $id = explode(',', $this->request->id); - return $this->city_model->whereIn('parent_country_id', $id)->get(); + return $this->city_model->whereIn('parent_country_id', $id)->orderBy('order', 'ASC')->get(); } } @@ -78,7 +78,7 @@ class AjaxController extends PublicController { if ($this->request->id) { $id = explode(',', $this->request->id); - return $this->district_model->whereIn('parent_city_id', $id)->get(); + return $this->district_model->whereIn('parent_city_id', $id)->orderBy('order', 'ASC')->get(); } } @@ -89,7 +89,7 @@ class AjaxController extends PublicController { if ($this->request->id) { $id = explode(',', $this->request->id); - return $this->neighborhood_model->whereIn('parent_district_id', $id)->get(); + return $this->neighborhood_model->whereIn('parent_district_id', $id)->orderBy('order', 'ASC')->get(); } } @@ -100,7 +100,7 @@ class AjaxController extends PublicController { if ($this->request->id) { $id = explode(',', $this->request->id); - return $this->village_model->whereIn('parent_neighborhood_id', $id)->get(); + return $this->village_model->whereIn('parent_neighborhood_id', $id)->orderBy('order', 'ASC')->get(); } } } \ No newline at end of file diff --git a/addons/default/visiosoft/location-module/src/LocationModuleSeeder.php b/addons/default/visiosoft/location-module/src/LocationModuleSeeder.php index c53714fdd..0023fa962 100644 --- a/addons/default/visiosoft/location-module/src/LocationModuleSeeder.php +++ b/addons/default/visiosoft/location-module/src/LocationModuleSeeder.php @@ -28,8 +28,8 @@ class LocationModuleSeeder extends Seeder Model::unguard(); DB::unprepared(file_get_contents(__DIR__.'/countries.sql')); DB::unprepared(file_get_contents(__DIR__.'/cities.sql')); - DB::unprepared(file_get_contents(__DIR__.'/districts.sql')); - DB::unprepared(file_get_contents(__DIR__.'/neighborhoods.sql')); +// DB::unprepared(file_get_contents(__DIR__.'/districts.sql')); +// DB::unprepared(file_get_contents(__DIR__.'/neighborhoods.sql')); Model::reguard(); /* Demo Stop*/ } diff --git a/addons/default/visiosoft/location-module/src/Neighborhood/Table/NeighborhoodTableBuilder.php b/addons/default/visiosoft/location-module/src/Neighborhood/Table/NeighborhoodTableBuilder.php index c5e158e1c..24461448b 100644 --- a/addons/default/visiosoft/location-module/src/Neighborhood/Table/NeighborhoodTableBuilder.php +++ b/addons/default/visiosoft/location-module/src/Neighborhood/Table/NeighborhoodTableBuilder.php @@ -61,7 +61,7 @@ class NeighborhoodTableBuilder extends TableBuilder */ protected $options = [ 'order_by' => [ - 'id' => 'DESC', + 'sort_order' => 'ASC', ], ]; diff --git a/addons/default/visiosoft/location-module/src/Village/Table/VillageTableBuilder.php b/addons/default/visiosoft/location-module/src/Village/Table/VillageTableBuilder.php index be16276dd..5c79b4666 100644 --- a/addons/default/visiosoft/location-module/src/Village/Table/VillageTableBuilder.php +++ b/addons/default/visiosoft/location-module/src/Village/Table/VillageTableBuilder.php @@ -52,7 +52,7 @@ class VillageTableBuilder extends TableBuilder */ protected $options = [ 'order_by' => [ - 'id' => 'DESC', + 'sort_order' => 'ASC', ], ]; /**