From 2166ef2443404e1c5d68be20b63888847f8f70c3 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 14 Mar 2022 06:01:40 +0000 Subject: [PATCH] server_shokki_adv_api --- .../api/AdvertisementsController.php | 1 + .../components/advertisement/carousel.htm | 2 +- .../components/advertisement/single.htm | 3 +-- .../components/advertisement/slider.htm | 2 +- .../tps/reklama/models/reklama/columns.yaml | 4 ++++ .../tps/reklama/models/reklama/fields.yaml | 4 ++++ ...ilder_table_update_tps_reklama_item_10.php | 23 +++++++++++++++++++ ...ilder_table_update_tps_reklama_item_11.php | 23 +++++++++++++++++++ ...ilder_table_update_tps_reklama_item_12.php | 23 +++++++++++++++++++ ...ilder_table_update_tps_reklama_item_13.php | 23 +++++++++++++++++++ plugins/tps/reklama/updates/version.yaml | 12 ++++++++++ 11 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_10.php create mode 100644 plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_11.php create mode 100644 plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_12.php create mode 100644 plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_13.php diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/AdvertisementsController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/AdvertisementsController.php index 17d9397ad..8a80bbe6d 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/AdvertisementsController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/AdvertisementsController.php @@ -26,6 +26,7 @@ class AdvertisementsController extends Controller //categories list $data = $this->Reklama->select('id','title', 'url', DB::raw("IF(media_mobile<>'',concat('$path',media_mobile),media_mobile) as media_mobile")) ->where('active',1) + ->orderBy('order_app', 'ASC') ->paginate(5) ->toArray(); diff --git a/plugins/tps/reklama/components/advertisement/carousel.htm b/plugins/tps/reklama/components/advertisement/carousel.htm index 88fed663e..cefb4218c 100644 --- a/plugins/tps/reklama/components/advertisement/carousel.htm +++ b/plugins/tps/reklama/components/advertisement/carousel.htm @@ -21,7 +21,7 @@ > - {{reklama.title}} + {{reklama.title}} {% endfor %} diff --git a/plugins/tps/reklama/components/advertisement/single.htm b/plugins/tps/reklama/components/advertisement/single.htm index e0c181332..e49b5a5cb 100644 --- a/plugins/tps/reklama/components/advertisement/single.htm +++ b/plugins/tps/reklama/components/advertisement/single.htm @@ -1,4 +1,3 @@ - {% set reklama = __SELF__.group.adds.first %} - {{reklama.title}} + {{reklama.title}} diff --git a/plugins/tps/reklama/components/advertisement/slider.htm b/plugins/tps/reklama/components/advertisement/slider.htm index fb992821b..263988748 100644 --- a/plugins/tps/reklama/components/advertisement/slider.htm +++ b/plugins/tps/reklama/components/advertisement/slider.htm @@ -12,7 +12,7 @@ > - {{reklama.title}} + {{reklama.title}} {% endfor %} diff --git a/plugins/tps/reklama/models/reklama/columns.yaml b/plugins/tps/reklama/models/reklama/columns.yaml index 0b419c198..ab9623f7e 100644 --- a/plugins/tps/reklama/models/reklama/columns.yaml +++ b/plugins/tps/reklama/models/reklama/columns.yaml @@ -39,3 +39,7 @@ columns: type: text searchable: true sortable: true + order_app: + label: 'App Order' + type: number + sortable: true diff --git a/plugins/tps/reklama/models/reklama/fields.yaml b/plugins/tps/reklama/models/reklama/fields.yaml index d17d9232a..cea8d7e80 100644 --- a/plugins/tps/reklama/models/reklama/fields.yaml +++ b/plugins/tps/reklama/models/reklama/fields.yaml @@ -19,6 +19,10 @@ fields: span: auto required: 1 type: relation + order_app: + label: 'Order Application' + span: auto + type: number order: label: 'Sort order' span: auto diff --git a/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_10.php b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_10.php new file mode 100644 index 000000000..6ae9b56be --- /dev/null +++ b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_10.php @@ -0,0 +1,23 @@ +integer('order_num')->default(0); + }); + } + + public function down() + { + Schema::table('tps_reklama_item', function($table) + { + $table->dropColumn('order_num'); + }); + } +} diff --git a/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_11.php b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_11.php new file mode 100644 index 000000000..94eff3289 --- /dev/null +++ b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_11.php @@ -0,0 +1,23 @@ +integer('order_num')->default(9999)->change(); + }); + } + + public function down() + { + Schema::table('tps_reklama_item', function($table) + { + $table->integer('order_num')->default(0)->change(); + }); + } +} diff --git a/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_12.php b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_12.php new file mode 100644 index 000000000..f697beae6 --- /dev/null +++ b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_12.php @@ -0,0 +1,23 @@ +dropColumn('order_num'); + }); + } + + public function down() + { + Schema::table('tps_reklama_item', function($table) + { + $table->integer('order_num')->default(9999); + }); + } +} diff --git a/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_13.php b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_13.php new file mode 100644 index 000000000..628d7aa15 --- /dev/null +++ b/plugins/tps/reklama/updates/builder_table_update_tps_reklama_item_13.php @@ -0,0 +1,23 @@ +integer('order_app')->default(999); + }); + } + + public function down() + { + Schema::table('tps_reklama_item', function($table) + { + $table->dropColumn('order_app'); + }); + } +} diff --git a/plugins/tps/reklama/updates/version.yaml b/plugins/tps/reklama/updates/version.yaml index b0e73c1b5..58478a1c8 100644 --- a/plugins/tps/reklama/updates/version.yaml +++ b/plugins/tps/reklama/updates/version.yaml @@ -42,3 +42,15 @@ 1.0.15: - 'Updated table tps_reklama_item' - builder_table_update_tps_reklama_item_9.php +1.0.16: + - 'Updated table tps_reklama_item' + - builder_table_update_tps_reklama_item_10.php +1.0.17: + - 'Updated table tps_reklama_item' + - builder_table_update_tps_reklama_item_11.php +1.0.18: + - 'Updated table tps_reklama_item' + - builder_table_update_tps_reklama_item_12.php +1.0.19: + - 'Updated table tps_reklama_item' + - builder_table_update_tps_reklama_item_13.php