From df6ddbd9444f88d0e130bf39297202ba6fd96ec6 Mon Sep 17 00:00:00 2001 From: Cerosop Date: Sat, 6 Jul 2024 00:12:46 +0800 Subject: [PATCH 1/7] feat: add judge point rule --- .../views/judgement/includes/rule.blade.php | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/resources/views/judgement/includes/rule.blade.php b/resources/views/judgement/includes/rule.blade.php index 3ee0bd7..53c4915 100644 --- a/resources/views/judgement/includes/rule.blade.php +++ b/resources/views/judgement/includes/rule.blade.php @@ -189,3 +189,114 @@ + +
+

分數計算規則

+ 根據上述分級依照以下規則計算出分數 +

天數

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
天數傳統路分數非傳統路分數
1510
21015
31020
41525
51530
62035
72040
82045
9+2550
+
+ +

路況

+ 路況分數 = 路況分數 + (路跡 * 0.3 + 地形 * 0.4 + 植被 * 0.3) * 1.5 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
路況分級分數
1
11
三a21
三b26
四a31
四b36
+
+ +

體力

+ 體力分數 = 體力分級 * 7 + 背水天數 * 2 + +

行程加權

+ 壓縮行程 -> 總分 * 1.1 + 寬鬆行程 -> 總分 * 0.9 +
From f9e23ee1ce683015f0bbc195a4c54116667abd41 Mon Sep 17 00:00:00 2001 From: Ben901227 Date: Sun, 7 Jul 2024 18:26:01 +0800 Subject: [PATCH 2/7] =?UTF-8?q?NCUMT-34=20table=20schema=20=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E8=A8=BB=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/CalendarController.php | 9 ++- ...er_and_modify_user_to_judgements_table.php | 2 +- ...6_add_comments_to_course_records_table.php | 46 ++++++++++++++ ...7_163641_add_comments_to_courses_table.php | 53 ++++++++++++++++ ...64331_add_comments_to_equipments_table.php | 53 ++++++++++++++++ ...07_171146_add_comments_to_events_table.php | 45 ++++++++++++++ ...7_07_172344_add_comments_to_faqs_table.php | 40 ++++++++++++ ...72642_add_comments_to_judgements_table.php | 61 +++++++++++++++++++ ..._07_174152_add_comments_to_posts_table.php | 46 ++++++++++++++ ...mments_to_record_comment_replies_table.php | 42 +++++++++++++ ..._add_comments_to_record_comments_table.php | 40 ++++++++++++ ...7_180927_add_comments_to_records_table.php | 49 +++++++++++++++ ...add_comments_to_rental_equipment_table.php | 40 ++++++++++++ ...7_181850_add_comments_to_rentals_table.php | 46 ++++++++++++++ ..._07_182204_add_comments_to_users_table.php | 56 +++++++++++++++++ 15 files changed, 622 insertions(+), 6 deletions(-) create mode 100644 database/migrations/2024_07_07_161156_add_comments_to_course_records_table.php create mode 100644 database/migrations/2024_07_07_163641_add_comments_to_courses_table.php create mode 100644 database/migrations/2024_07_07_164331_add_comments_to_equipments_table.php create mode 100644 database/migrations/2024_07_07_171146_add_comments_to_events_table.php create mode 100644 database/migrations/2024_07_07_172344_add_comments_to_faqs_table.php create mode 100644 database/migrations/2024_07_07_172642_add_comments_to_judgements_table.php create mode 100644 database/migrations/2024_07_07_174152_add_comments_to_posts_table.php create mode 100644 database/migrations/2024_07_07_180208_add_comments_to_record_comment_replies_table.php create mode 100644 database/migrations/2024_07_07_180649_add_comments_to_record_comments_table.php create mode 100644 database/migrations/2024_07_07_180927_add_comments_to_records_table.php create mode 100644 database/migrations/2024_07_07_181337_add_comments_to_rental_equipment_table.php create mode 100644 database/migrations/2024_07_07_181850_add_comments_to_rentals_table.php create mode 100644 database/migrations/2024_07_07_182204_add_comments_to_users_table.php diff --git a/app/Http/Controllers/CalendarController.php b/app/Http/Controllers/CalendarController.php index 552399c..933df86 100644 --- a/app/Http/Controllers/CalendarController.php +++ b/app/Http/Controllers/CalendarController.php @@ -2,23 +2,22 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; use App\Models\Event; -use Carbon\Carbon; +use Illuminate\Http\Request; class CalendarController extends Controller { /** * Display a listing of the resource. * - * @return \Illuminate\Http\Response + * @return array */ public function index() { $calendar_events = array(); $events = Event::all(); $category_array =['#A8D8B9', '#7DB9DE','#E6E5A3', '#9B90C2', '#E87A90']; // 0 => 爬山(綠色), 1 => 溯溪(藍色), 2 => 社課(黃色), 3 => 開會(紫色), 4' => 山防(紅色) - $category = ['0' => "出隊 | ", '1' => "出隊 | ", '2' => "社課 | ", '3' => "討論 | ", '4' => "山防 | "]; + $category = ['0' => "出隊 | ", '1' => "溯溪 | ", '2' => "社課 | ", '3' => "討論 | ", '4' => "山防 | "]; foreach ($events as $event) { $calendar_events[] = [ 'id' => $event->id, @@ -28,7 +27,7 @@ public function index() 'color' => $category_array[$event->category], ]; } - + return $calendar_events; } /** diff --git a/database/migrations/2024_06_15_201813_add_create_user_and_modify_user_to_judgements_table.php b/database/migrations/2024_06_15_201813_add_create_user_and_modify_user_to_judgements_table.php index 4ea72fd..dfd6f01 100644 --- a/database/migrations/2024_06_15_201813_add_create_user_and_modify_user_to_judgements_table.php +++ b/database/migrations/2024_06_15_201813_add_create_user_and_modify_user_to_judgements_table.php @@ -14,7 +14,7 @@ class AddCreateUserAndModifyUserToJudgementsTable extends Migration public function up() { Schema::table('judgements', function (Blueprint $table) { - $table->unsignedBigInteger('create_user')->nullable()->after('created_at'); // 假設 'id' 是表中的第一個欄位 + $table->unsignedBigInteger('create_user')->nullable()->after('created_at'); $table->unsignedBigInteger('modify_user')->nullable()->after('create_user'); }); } diff --git a/database/migrations/2024_07_07_161156_add_comments_to_course_records_table.php b/database/migrations/2024_07_07_161156_add_comments_to_course_records_table.php new file mode 100644 index 0000000..3d364a9 --- /dev/null +++ b/database/migrations/2024_07_07_161156_add_comments_to_course_records_table.php @@ -0,0 +1,46 @@ +comment = '社課登記表,紀錄有誰報名過社課'; + $table->unsignedBigInteger('user_id')->comment('使用者 ID')->change(); + $table->unsignedBigInteger('course_id')->comment('社課 ID')->change(); + $table->unsignedBigInteger('create_user')->after('updated_at')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->after('create_user')->nullable()->comment('更新者 ID'); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('course_records', function (Blueprint $table) { + // Remove added columns + $table->dropColumn('create_user'); + $table->dropColumn('modify_user'); + + // Remove comments + $table->unsignedBigInteger('user_id')->comment(null)->change(); + $table->unsignedBigInteger('course_id')->comment(null)->change(); + $table->timestamp('created_at')->nullable()->comment(null)->change(); + $table->timestamp('updated_at')->nullable()->comment(null)->change(); + $table->comment = null; + }); + } +} diff --git a/database/migrations/2024_07_07_163641_add_comments_to_courses_table.php b/database/migrations/2024_07_07_163641_add_comments_to_courses_table.php new file mode 100644 index 0000000..26f45ae --- /dev/null +++ b/database/migrations/2024_07_07_163641_add_comments_to_courses_table.php @@ -0,0 +1,53 @@ +unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + + $table->comment = '社課資訊表,紀錄社課詳細資訊'; + $table->string('title', 50)->comment('標題')->change(); + $table->string('videoURL', 255)->nullable()->comment('影片 URL')->change(); + $table->string('pptURL', 255)->nullable()->comment('PPT URL')->change(); + $table->string('image', 255)->comment('圖片路徑')->change(); + $table->date('date')->comment('社課日期')->change(); + $table->string('speaker', 255)->comment('講者')->change(); + $table->string('location', 255)->comment('地點')->change(); + $table->text('description')->comment('社課簡介')->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('courses', function (Blueprint $table) { + $table->dropColumn('create_user'); + $table->dropColumn('modify_user'); + $table->string('title', 50)->comment(null)->change(); + $table->string('videoURL', 255)->nullable()->comment(null)->change(); + $table->string('pptURL', 255)->nullable()->comment(null)->change(); + $table->string('image', 255)->comment(null)->change(); + $table->date('date')->comment(null)->change(); + $table->string('speaker', 255)->comment(null)->change(); + $table->string('location', 255)->comment(null)->change(); + $table->text('description')->comment(null)->change(); + $table->comment = null; + }); + } +} diff --git a/database/migrations/2024_07_07_164331_add_comments_to_equipments_table.php b/database/migrations/2024_07_07_164331_add_comments_to_equipments_table.php new file mode 100644 index 0000000..df35002 --- /dev/null +++ b/database/migrations/2024_07_07_164331_add_comments_to_equipments_table.php @@ -0,0 +1,53 @@ +unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + + $table->comment = '裝備資訊表'; + $table->string('category', 255)->nullable()->comment('裝備種類:大背包、睡袋、睡墊 ...')->change(); + $table->string('description', 255)->comment('裝備簡介')->change(); + $table->string('image', 255)->nullable()->comment('圖片路徑')->change(); + $table->date('bought_date')->nullable()->comment('購買日期')->change(); + $table->smallInteger('status')->default(0)->comment('是否出租(0 = 未借出, 1 = 借出, 2 = 遺失)')->change(); + $table->integer('size')->nullable()->comment('裝備尺寸')->change(); + $table->integer('member_price')->comment('社員租借費用')->change(); + $table->integer('normal_price')->comment('非社員租借非用')->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('equipments', function (Blueprint $table) { + $table->dropColumn('create_user'); + $table->dropColumn('modify_user'); + $table->comment = null; + $table->string('category', 255)->nullable()->comment(null)->change(); + $table->string('description', 255)->comment(null)->change(); + $table->string('image', 255)->nullable()->comment(null)->change(); + $table->date('bought_date')->nullable()->comment(null)->change(); + $table->smallInteger('status')->default(0)->comment(null)->change(); + $table->integer('size')->nullable()->comment(null)->change(); + $table->integer('member_price')->comment(null)->change(); + $table->integer('normal_price')->comment(null)->change(); + }); + } +} diff --git a/database/migrations/2024_07_07_171146_add_comments_to_events_table.php b/database/migrations/2024_07_07_171146_add_comments_to_events_table.php new file mode 100644 index 0000000..fc0a04c --- /dev/null +++ b/database/migrations/2024_07_07_171146_add_comments_to_events_table.php @@ -0,0 +1,45 @@ +comment = '行事曆活動記錄表'; + $table->string('title')->comment('活動名稱')->change(); + $table->datetime('start')->comment('開始時間')->change(); + $table->datetime('end')->comment('結束時間')->change(); + $table->integer('category')->comment('活動種類(0 = 出隊, 1 = 溯溪, 2 = 社課, 3 = 討論, 4 = 山防')->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('events', function (Blueprint $table) { + $table->dropColumn('create_user'); + $table->dropColumn('modify_user'); + $table->comment = null; + $table->string('title')->comment(null)->change(); + $table->datetime('start')->comment(null)->change(); + $table->datetime('end')->comment(null)->change(); + $table->integer('category')->comment(null)->change(); + }); + } +} diff --git a/database/migrations/2024_07_07_172344_add_comments_to_faqs_table.php b/database/migrations/2024_07_07_172344_add_comments_to_faqs_table.php new file mode 100644 index 0000000..ced2f98 --- /dev/null +++ b/database/migrations/2024_07_07_172344_add_comments_to_faqs_table.php @@ -0,0 +1,40 @@ +comment = 'QA 紀錄表'; // Table comment + $table->string('question')->comment('問題')->change(); + $table->longText('answer')->comment('答案')->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('faqs', function (Blueprint $table) { + $table->dropColumn('create_user'); + $table->dropColumn('modify_user'); + $table->comment = null; + $table->string('question')->comment(null)->change(); + $table->longText('answer')->comment(null)->change(); + }); + } +} diff --git a/database/migrations/2024_07_07_172642_add_comments_to_judgements_table.php b/database/migrations/2024_07_07_172642_add_comments_to_judgements_table.php new file mode 100644 index 0000000..cb58a08 --- /dev/null +++ b/database/migrations/2024_07_07_172642_add_comments_to_judgements_table.php @@ -0,0 +1,61 @@ +comment = '隊伍難度評分表'; + $table->string('name')->comment('隊伍名稱')->change(); + $table->integer('normal_day')->comment('傳統路天數')->change(); + $table->integer('abnormal_day')->comment('非傳統路天數')->change(); + $table->integer('level')->comment('路況分級')->change(); + $table->integer('road')->comment('路跡級別')->change(); + $table->integer('terrain')->comment('地形級別')->change(); + $table->integer('plant')->comment('植被級別')->change(); + $table->integer('energy')->comment('體力級別')->change(); + $table->integer('water')->comment('多背水天數')->change(); + $table->string('result_level')->comment('難度等級')->change(); + $table->integer('score')->comment('難度總分')->change(); + $table->integer('trip_tag')->default(0)->comment('行程(0 = 一般行程, 1 = 壓縮行程, 2 = 寬鬆行程')->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID')->change(); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID')->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('judgements', function (Blueprint $table) { + $table->comment = null; + $table->string('name')->comment(null)->change(); + $table->integer('normal_day')->comment(null)->change(); + $table->integer('abnormal_day')->comment(null)->change(); + $table->integer('level')->comment(null)->change(); + $table->integer('road')->comment(null)->change(); + $table->integer('terrain')->comment(null)->change(); + $table->integer('plant')->comment(null)->change(); + $table->integer('energy')->comment(null)->change(); + $table->integer('water')->comment(null)->change(); + $table->string('result_level')->comment(null)->change(); + $table->integer('score')->comment(null)->change(); + $table->integer('trip_tag')->comment(null)->change(); + $table->unsignedBigInteger('create_user')->comment(null)->change(); + $table->unsignedBigInteger('modify_user')->comment(null)->change(); + }); + } +} diff --git a/database/migrations/2024_07_07_174152_add_comments_to_posts_table.php b/database/migrations/2024_07_07_174152_add_comments_to_posts_table.php new file mode 100644 index 0000000..9ee3c06 --- /dev/null +++ b/database/migrations/2024_07_07_174152_add_comments_to_posts_table.php @@ -0,0 +1,46 @@ +comment = '公告資訊表'; + $table->integer('type')->comment('類型(0 = 隊伍, 1 = 社課, 2 = 其他')->change(); + $table->smallInteger('pin')->default(0)->comment('是否置頂 (0 = 否, 1 = 是)')->change(); + $table->string('title', 50)->comment('標題')->change(); + $table->text('content')->comment('內容')->change(); + $table->datetime('expired_at')->comment('過期時間')->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('posts', function (Blueprint $table) { + $table->comment = null; + $table->integer('type')->comment(null)->change(); + $table->smallInteger('pin')->default(0)->comment(null)->change(); + $table->string('title', 50)->comment(null)->change(); + $table->text('content')->comment(null)->change(); + $table->datetime('expired_at')->comment(null)->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment(null)->change(); + $table->unsignedBigInteger('modify_user')->nullable()->comment(null)->change(); + }); + } +} diff --git a/database/migrations/2024_07_07_180208_add_comments_to_record_comment_replies_table.php b/database/migrations/2024_07_07_180208_add_comments_to_record_comment_replies_table.php new file mode 100644 index 0000000..eb392b5 --- /dev/null +++ b/database/migrations/2024_07_07_180208_add_comments_to_record_comment_replies_table.php @@ -0,0 +1,42 @@ +comment = '紀錄評論回覆表'; + $table->text('content')->comment('回覆內容')->change(); + $table->unsignedBigInteger('record_comment_id')->comment('評論 ID')->change(); + $table->unsignedBigInteger('record_id')->comment('記錄 ID')->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('record_comment_replies', function (Blueprint $table) { + $table->comment = null; + $table->text('content')->comment(null)->change(); + $table->unsignedBigInteger('record_comment_id')->comment(null)->change(); + $table->unsignedBigInteger('record_id')->comment(null)->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment(null)->change();; + $table->unsignedBigInteger('modify_user')->nullable()->comment(null)->change();; + }); + } +} diff --git a/database/migrations/2024_07_07_180649_add_comments_to_record_comments_table.php b/database/migrations/2024_07_07_180649_add_comments_to_record_comments_table.php new file mode 100644 index 0000000..6276b18 --- /dev/null +++ b/database/migrations/2024_07_07_180649_add_comments_to_record_comments_table.php @@ -0,0 +1,40 @@ +comment = '紀錄評論表'; + $table->text('content')->comment('評論內容')->change(); + $table->unsignedBigInteger('record_id')->comment('記錄 ID')->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('record_comments', function (Blueprint $table) { + $table->comment = null; + $table->text('content')->comment(null)->change(); + $table->unsignedBigInteger('record_id')->comment(null)->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment(null)->change();; + $table->unsignedBigInteger('modify_user')->nullable()->comment(null)->change();; + }); + } +} diff --git a/database/migrations/2024_07_07_180927_add_comments_to_records_table.php b/database/migrations/2024_07_07_180927_add_comments_to_records_table.php new file mode 100644 index 0000000..b699658 --- /dev/null +++ b/database/migrations/2024_07_07_180927_add_comments_to_records_table.php @@ -0,0 +1,49 @@ +comment = '隊伍記錄表'; + $table->string('name')->comment('路線名稱')->change(); + $table->string('image')->comment('圖片路徑')->change(); + $table->text('content')->comment('紀錄內容')->change(); + $table->smallInteger('category')->comment('種類(0 = 中級山, 1 = 高山, 2 = 溯溪)')->change(); + $table->date('start_date')->comment('開始日期')->change(); + $table->date('end_date')->comment('結束日期')->change(); + $table->longText('description')->comment('路線簡介')->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('records', function (Blueprint $table) { + $table->string('name')->comment(null)->change(); + $table->string('image')->comment(null)->change(); + $table->text('content')->comment(null)->change(); + $table->smallInteger('category')->comment(null)->change(); + $table->date('start_date')->comment(null)->change(); + $table->date('end_date')->comment(null)->change(); + $table->longText('description')->comment(null)->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment(null)->change(); + $table->unsignedBigInteger('modify_user')->nullable()->comment(null)->change(); + }); + } +} diff --git a/database/migrations/2024_07_07_181337_add_comments_to_rental_equipment_table.php b/database/migrations/2024_07_07_181337_add_comments_to_rental_equipment_table.php new file mode 100644 index 0000000..76af641 --- /dev/null +++ b/database/migrations/2024_07_07_181337_add_comments_to_rental_equipment_table.php @@ -0,0 +1,40 @@ +comment = '裝備租借紀錄對應表'; + $table->integer('equipment_id')->comment('裝備 ID')->change(); + $table->integer('rental_id')->comment('租借紀錄 ID')->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('rental_equipment', function (Blueprint $table) { + $table->comment = null; + $table->integer('equipment_id')->comment(null)->change(); + $table->integer('rental_id')->comment(null)->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment(null)->change(); + $table->unsignedBigInteger('modify_user')->nullable()->comment(null)->change(); + }); + } +} diff --git a/database/migrations/2024_07_07_181850_add_comments_to_rentals_table.php b/database/migrations/2024_07_07_181850_add_comments_to_rentals_table.php new file mode 100644 index 0000000..fa358c3 --- /dev/null +++ b/database/migrations/2024_07_07_181850_add_comments_to_rentals_table.php @@ -0,0 +1,46 @@ +comment = '租借記錄表'; + $table->unsignedBigInteger('user_id')->comment('租借者 ID')->change(); + $table->date('rental_date')->comment('租借日期')->change(); + $table->date('return_date')->comment('預計歸還日期')->change(); + $table->date('actual_return_date')->comment('實際歸還日期')->change(); + $table->integer('rental_amount')->comment('租借總金額')->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('rentals', function (Blueprint $table) { + $table->comment = null; + $table->unsignedBigInteger('user_id')->comment(null)->change(); + $table->date('rental_date')->comment(null)->change(); + $table->date('return_date')->comment(null)->change(); + $table->date('actual_return_date')->comment(null)->change(); + $table->integer('rental_amount')->comment(null)->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment(null)->change(); + $table->unsignedBigInteger('modify_user')->nullable()->comment(null)->change(); + }); + } +} diff --git a/database/migrations/2024_07_07_182204_add_comments_to_users_table.php b/database/migrations/2024_07_07_182204_add_comments_to_users_table.php new file mode 100644 index 0000000..f06d96f --- /dev/null +++ b/database/migrations/2024_07_07_182204_add_comments_to_users_table.php @@ -0,0 +1,56 @@ +comment = '使用者表'; + $table->string('identifier')->nullable()->comment('學號')->change(); + $table->string('name_zh')->comment('中文名稱')->change(); + $table->string('email')->comment('電子信箱')->change(); + $table->string('name_en')->comment('英文名字')->change(); + $table->string('nickname')->nullable()->comment('暱稱')->change(); + $table->string('phone')->nullable()->comment('手機')->change(); + $table->integer('role')->default(0)->comment('角色')->change(); + $table->integer('token_tg')->nullable()->comment('Telegram Token')->change(); + $table->integer('token_line')->nullable()->comment('LINE Token')->change(); + $table->string('remember_token')->nullable()->comment('Remember Token')->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->comment = null; + $table->string('identifier')->nullable()->comment(null)->change(); + $table->string('name_zh')->comment(null)->change(); + $table->string('email')->comment(null)->change(); + $table->string('name_en')->comment(null)->change(); + $table->string('nickname')->nullable()->comment(null)->change(); + $table->string('phone')->nullable()->comment(null)->change(); + $table->integer('role')->default(0)->comment(null)->change(); + $table->integer('token_tg')->nullable()->comment(null)->change(); + $table->integer('token_line')->nullable()->comment(null)->change(); + $table->string('remember_token')->nullable()->comment(null)->change(); + $table->unsignedBigInteger('create_user')->nullable()->comment(null)->change(); + $table->unsignedBigInteger('modify_user')->nullable()->comment(null)->change(); + }); + } +} From d84064118a111e93182972b592bb43e56cc571bc Mon Sep 17 00:00:00 2001 From: Cerosop Date: Mon, 8 Jul 2024 02:45:05 +0800 Subject: [PATCH 3/7] move point rule to new route --- app/Http/Controllers/JudgementController.php | 10 ++ resources/views/basic/navbar.blade.php | 1 + .../views/judgement/includes/rule.blade.php | 109 ---------------- resources/views/judgement/pointRule.blade.php | 122 ++++++++++++++++++ routes/web.php | 1 + 5 files changed, 134 insertions(+), 109 deletions(-) create mode 100644 resources/views/judgement/pointRule.blade.php diff --git a/app/Http/Controllers/JudgementController.php b/app/Http/Controllers/JudgementController.php index a054f46..637180c 100644 --- a/app/Http/Controllers/JudgementController.php +++ b/app/Http/Controllers/JudgementController.php @@ -52,4 +52,14 @@ public function rule() return view('judgement.rule'); } + /** + * 顯示評分紀錄規則 + * + * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View + */ + public function pointRule() + { + return view('judgement.pointRule'); + } + } diff --git a/resources/views/basic/navbar.blade.php b/resources/views/basic/navbar.blade.php index ec61fbe..8699890 100644 --- a/resources/views/basic/navbar.blade.php +++ b/resources/views/basic/navbar.blade.php @@ -21,6 +21,7 @@
  • 評分系統
  • 評分紀錄
  • 評分規則
  • +
  • 分數計算
  • @guest
  • 所有紀錄
  • diff --git a/resources/views/judgement/includes/rule.blade.php b/resources/views/judgement/includes/rule.blade.php index 53c4915..638e6d8 100644 --- a/resources/views/judgement/includes/rule.blade.php +++ b/resources/views/judgement/includes/rule.blade.php @@ -190,113 +190,4 @@ -
    -

    分數計算規則

    - 根據上述分級依照以下規則計算出分數 -

    天數

    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    天數傳統路分數非傳統路分數
    1510
    21015
    31020
    41525
    51530
    62035
    72040
    82045
    9+2550
    -
    -

    路況

    - 路況分數 = 路況分數 + (路跡 * 0.3 + 地形 * 0.4 + 植被 * 0.3) * 1.5 -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    路況分級分數
    1
    11
    三a21
    三b26
    四a31
    四b36
    -
    - -

    體力

    - 體力分數 = 體力分級 * 7 + 背水天數 * 2 - -

    行程加權

    - 壓縮行程 -> 總分 * 1.1 - 寬鬆行程 -> 總分 * 0.9 -
    diff --git a/resources/views/judgement/pointRule.blade.php b/resources/views/judgement/pointRule.blade.php new file mode 100644 index 0000000..bf212f3 --- /dev/null +++ b/resources/views/judgement/pointRule.blade.php @@ -0,0 +1,122 @@ +@extends('basic.main') + +@section('title', '評分標準') + +@section('content') +
    +
    +
    +
    +

    分數計算規則

    +
    +
    +

    天數

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    天數傳統路分數非傳統路分數
    1510
    21015
    31020
    41525
    51530
    62035
    72040
    82045
    9+2550
    +
    + +

    路況

    + 路況分數 = 路況分數 + (路跡 * 0.3 + 地形 * 0.4 + 植被 * 0.3) * 1.5 +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    路況分級分數
    1
    11
    三a21
    三b26
    四a31
    四b36
    +
    + +

    體力

    + 體力分數 = 體力分級 * 7 + 背水天數 * 2 + +

    行程加權

    + 壓縮行程 -> 總分 * 1.1 + 寬鬆行程 -> 總分 * 0.9 +
    +
    +
    +
    +@endsection diff --git a/routes/web.php b/routes/web.php index c264d77..e513d2b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -44,6 +44,7 @@ Route::get('/judgement', [JudgementController::class, 'index'])->name('judgement.index'); Route::get('/judgement/record', [JudgementController::class, 'record'])->name('judgement.record'); Route::get('/judgement/rule', [JudgementController::class, 'rule'])->name('judgement.rule'); +Route::get('/judgement/pointRule', [JudgementController::class, 'pointRule'])->name('judgement.pointRule'); Route::get('/faq', [FaqController::class, 'index'])->name('faq.index'); Route::get('/record', [RecordController::class, 'index'])->name('record.index'); Route::get('/record/show/{id}', [RecordController::class, 'show'])->name('record.show'); From 0927d95bb4f370605e8670852d28a57d250f2dbd Mon Sep 17 00:00:00 2001 From: benyi Date: Mon, 15 Jul 2024 22:04:01 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20equipments=20schema=20=E8=A8=BB?= =?UTF-8?q?=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2024_07_07_164331_add_comments_to_equipments_table.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/2024_07_07_164331_add_comments_to_equipments_table.php b/database/migrations/2024_07_07_164331_add_comments_to_equipments_table.php index df35002..f468a08 100644 --- a/database/migrations/2024_07_07_164331_add_comments_to_equipments_table.php +++ b/database/migrations/2024_07_07_164331_add_comments_to_equipments_table.php @@ -18,7 +18,7 @@ public function up() $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); $table->comment = '裝備資訊表'; - $table->string('category', 255)->nullable()->comment('裝備種類:大背包、睡袋、睡墊 ...')->change(); + $table->string('name', 255)->nullable()->comment('裝備種類:大背包、睡袋、睡墊 ...')->change(); $table->string('description', 255)->comment('裝備簡介')->change(); $table->string('image', 255)->nullable()->comment('圖片路徑')->change(); $table->date('bought_date')->nullable()->comment('購買日期')->change(); @@ -40,7 +40,7 @@ public function down() $table->dropColumn('create_user'); $table->dropColumn('modify_user'); $table->comment = null; - $table->string('category', 255)->nullable()->comment(null)->change(); + $table->string('name', 255)->nullable()->comment(null)->change(); $table->string('description', 255)->comment(null)->change(); $table->string('image', 255)->nullable()->comment(null)->change(); $table->date('bought_date')->nullable()->comment(null)->change(); From e9013259c85669ba8103a95a1e1ffcb2e31c4528 Mon Sep 17 00:00:00 2001 From: Ben901227 Date: Tue, 16 Jul 2024 23:39:35 +0800 Subject: [PATCH 5/7] =?UTF-8?q?NCUMT-43=20=E5=BB=BA=E7=AB=8B=E9=9A=8A?= =?UTF-8?q?=E4=BC=8D=E8=88=87=E9=9A=8A=E4=BC=8D=E4=BA=BA=E5=93=A1=20DB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2024_07_16_231935_create_trips_table.php | 48 +++++++++++++++++++ ...07_16_231937_create_trip_members_table.php | 36 ++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 database/migrations/2024_07_16_231935_create_trips_table.php create mode 100644 database/migrations/2024_07_16_231937_create_trip_members_table.php diff --git a/database/migrations/2024_07_16_231935_create_trips_table.php b/database/migrations/2024_07_16_231935_create_trips_table.php new file mode 100644 index 0000000..8ad4223 --- /dev/null +++ b/database/migrations/2024_07_16_231935_create_trips_table.php @@ -0,0 +1,48 @@ +id(); + $table->unsignedBigInteger('leader_id')->comment('領隊 id'); + $table->integer('expected_cadre_count')->comment('預計幹部人數'); + $table->integer('expected_member_count')->comment('預計隊員人數'); + $table->string('name')->comment('隊伍名稱'); + $table->text('description')->comment('隊伍簡介'); + $table->smallInteger('category')->comment('隊伍分類'); + $table->date('start_date')->comment('隊伍開始日期'); + $table->date('end_date')->comment('隊伍結束日期'); + $table->string('image')->comment('封面圖片路徑'); + $table->decimal('expected_fee', 8, 2)->comment('預期隊費'); + $table->decimal('actual_fee', 8, 2)->nullable()->comment('實際隊費'); + $table->dateTime('registration_open')->comment('報名開始時間'); + $table->dateTime('registration_close')->comment('報名結束時間'); + $table->dateTime('pre_departure_time')->nullable()->comment('行前會時間'); + $table->integer('judgements_id')->comment('隊伍難度 id'); + $table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('trips'); + } +} diff --git a/database/migrations/2024_07_16_231937_create_trip_members_table.php b/database/migrations/2024_07_16_231937_create_trip_members_table.php new file mode 100644 index 0000000..bdaa899 --- /dev/null +++ b/database/migrations/2024_07_16_231937_create_trip_members_table.php @@ -0,0 +1,36 @@ +id(); + $table->integer('users_id')->comment('隊員 id'); + $table->integer('trips_id')->comment('隊伍 id'); + $table->integer('role')->comment('職位(0: 隊員, 1: 公文, 2: 菜單, 3: 總務, 4: 器材, 5: 紀錄, 6: 保險, 7: 交通, 8: 入山, 9:採買, 10: 醫藥, 11: 氣象)'); + $table->unsignedBigInteger('create_user')->nullable()->comment('建立者 ID'); + $table->unsignedBigInteger('modify_user')->nullable()->comment('更新者 ID'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('trip_members'); + } +} From c66c3549a5e1754e20d82ed132fdc173101069fb Mon Sep 17 00:00:00 2001 From: YudSu Date: Wed, 17 Jul 2024 21:26:58 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=90=9C=E5=B0=8B?= =?UTF-8?q?=E7=B5=90=E6=9E=9C=E2=80=94=E9=9A=8A=E4=BC=8D=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZenBlog/search-result.html | 118 ++++---- public/sitemap.xml | 68 +---- resources/views/trip/tripList.blade.php | 348 ++++++++++++++++++++++++ routes/web.php | 4 + 4 files changed, 416 insertions(+), 122 deletions(-) create mode 100644 resources/views/trip/tripList.blade.php diff --git a/ZenBlog/search-result.html b/ZenBlog/search-result.html index 1848657..1a36787 100644 --- a/ZenBlog/search-result.html +++ b/ZenBlog/search-result.html @@ -110,22 +110,30 @@

    ZenBlog

    Search Results

    -
    - - - -
    - -

    What is the son of Football Coach John Gruden, Deuce Gruden doing Now?

    -

    Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio placeat exercitationem magni voluptates dolore. Tenetur fugiat voluptates quas.

    -
    -
    -
    -

    Wade Warren

    +
    + + + +
    + +

    北坑溪古道-日向到雪見

    +

    預定行程:乘車(=>)重裝(=>)輕裝(=>) +
    + 7/20(六) +
    + 中央大學 => 雪見遊憩區 => 日向駐在所 => 往萩岡駐在所探 => 日向駐在所 (C1) +
    + 7/21(日) +
    + 日向駐在所 => 三個溪溝崩壁 => 雪見駐在所 => 雪見遊憩區 +

    +
    +
    +

    領隊:易靖程

    +
    +
    -
    -
    @@ -218,9 +226,9 @@

    Wade Warren

    - + + + @@ -267,43 +275,43 @@

    10 Life-Changing Hacks Every Working Mom Should Kno

    - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    @@ -534,4 +542,4 @@ - \ No newline at end of file + diff --git a/public/sitemap.xml b/public/sitemap.xml index 51f71c4..24e6916 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -1,69 +1,3 @@ - - - http://ncumt.student.ncu.edu.tw/ - 2023-06-01T23:56:42+08:00 - daily - 0.8 - - - http://ncumt.student.ncu.edu.tw/faq - 2023-06-01T23:56:42+08:00 - daily - 0.8 - - - http://ncumt.student.ncu.edu.tw/course - 2023-06-01T23:56:42+08:00 - daily - 0.8 - - - http://ncumt.student.ncu.edu.tw/judgement - 2023-06-01T23:56:42+08:00 - daily - 0.8 - - - http://ncumt.student.ncu.edu.tw/record - 2023-06-01T23:56:42+08:00 - daily - 0.8 - - - http://ncumt.student.ncu.edu.tw/comingsoon - 2023-06-01T23:56:42+08:00 - daily - 0.8 - - - http://ncumt.student.ncu.edu.tw/portal - 2023-06-01T23:56:42+08:00 - daily - 0.8 - - - http://ncumt.student.ncu.edu.tw/record/9 - 2023-06-01T23:56:42+08:00 - daily - 0.8 - - - http://ncumt.student.ncu.edu.tw/record/12 - 2023-06-01T23:56:43+08:00 - daily - 0.8 - - - http://ncumt.student.ncu.edu.tw/record/10 - 2023-06-01T23:56:43+08:00 - daily - 0.8 - - - http://ncumt.student.ncu.edu.tw/portal/login - 2023-06-01T23:56:43+08:00 - daily - 0.8 - + diff --git a/resources/views/trip/tripList.blade.php b/resources/views/trip/tripList.blade.php new file mode 100644 index 0000000..5179683 --- /dev/null +++ b/resources/views/trip/tripList.blade.php @@ -0,0 +1,348 @@ +@extends('basic.main') + +@section('title', '隊伍報名列表') + +@section('content') + + +
    +
    +
    +
    +

    Search Results

    + +
    + + + +
    + +

    北坑溪古道-日向到雪見

    +

    預定行程:乘車(=>)重裝(=>)輕裝(=>) +
    + 7/20(六) +
    + 中央大學 => 雪見遊憩區 => 日向駐在所 => 往萩岡駐在所探 => 日向駐在所 (C1) +
    + 7/21(日) +
    + 日向駐在所 => 三個溪溝崩壁 => 雪見駐在所 => 雪見遊憩區 +

    +
    +
    +

    領隊:易靖程

    +
    +
    +
    +
    + +
    + + + +
    + +

    17 Pictures of Medium Length Hair in Layers That Will Inspire + Your New Haircut

    +

    Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio placeat + exercitationem magni voluptates dolore. Tenetur fugiat voluptates quas.

    +
    +
    +
    +

    Wade Warren

    +
    +
    +
    +
    + +
    + + + +
    + +

    The Best Homemade Masks for Face (keep the Pimples Away) +

    +

    Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio placeat + exercitationem magni voluptates dolore. Tenetur fugiat voluptates quas.

    +
    +
    +
    +

    Wade Warren

    +
    +
    +
    +
    + +
    + + + +
    + +

    10 Life-Changing Hacks Every Working Mom Should Know

    +

    Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio placeat + exercitationem magni voluptates dolore. Tenetur fugiat voluptates quas.

    +
    +
    +
    +

    Wade Warren

    +
    +
    +
    +
    + +
    + + + +
    + +

    9 Half-up/half-down Hairstyles for Long and Medium Hair +

    +

    Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio placeat + exercitationem magni voluptates dolore. Tenetur fugiat voluptates quas.

    +
    +
    +
    +

    Wade Warren

    +
    +
    +
    +
    + + +
    +
    + + 1 + 2 + 3 + 4 + 5 + +
    +
    + +
    + +
    + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +

    Life Insurance And Pregnancy: A Working Mom’s Guide +

    + Jenny Wilson +
    + +
    + +

    The Best Homemade Masks for Face (keep the Pimples + Away)

    + Jenny Wilson +
    + +
    + +

    10 Life-Changing Hacks Every Working Mom Should + Know

    + Jenny Wilson +
    + +
    + +

    How to Avoid Distraction and Stay Focused During Video + Calls?

    + Jenny Wilson +
    + +
    + +

    17 Pictures of Medium Length Hair in Layers That Will + Inspire Your New Haircut

    + Jenny Wilson +
    + +
    + +

    9 Half-up/half-down Hairstyles for Long and Medium + Hair

    + Jenny Wilson +
    + +
    + +
    +
    + +
    +

    Video

    +
    + + + + +
    +
    + + + +
    +

    Tags

    + +
    + +
    + +
    +
    +
    + +@endsection diff --git a/routes/web.php b/routes/web.php index 48f2af5..30db01d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -26,6 +26,10 @@ | */ +Route::get('/trip/list', function () { + return view('trip.tripList'); +}); + Route::fallback(function () { return redirect()->route('index'); }); From e8e63bdf3f84bd11341c8ce67b881b5627bca9f5 Mon Sep 17 00:00:00 2001 From: YudSu Date: Thu, 5 Sep 2024 21:00:29 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=90=9C=E5=B0=8B?= =?UTF-8?q?=E7=B5=90=E6=9E=9C=E2=80=94=E9=9A=8A=E4=BC=8D=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/trip/tripList.blade.php | 433 ++++++++++++------------ 1 file changed, 213 insertions(+), 220 deletions(-) diff --git a/resources/views/trip/tripList.blade.php b/resources/views/trip/tripList.blade.php index 5179683..922486d 100644 --- a/resources/views/trip/tripList.blade.php +++ b/resources/views/trip/tripList.blade.php @@ -9,25 +9,19 @@
    -

    Search Results

    +{{--

    Search Results

    --}}
    - +
    -