diff --git a/app/Models/HitAndRun.php b/app/Models/HitAndRun.php new file mode 100644 index 00000000..df98e3ba --- /dev/null +++ b/app/Models/HitAndRun.php @@ -0,0 +1,31 @@ + ['text' => '考察中'], + self::STATUS_PASSED => ['text' => '已通过'], + self::STATUS_NOT_PASSED => ['text' => '未通过'], + self::STATUS_CANCELED => ['text' => '已取消'], + ]; + + public function getStatusTextAttribute() + { + return self::$status[$this->status] ?? ''; + } + + +} diff --git a/database/migrations/2021_06_18_125347_create_hit_and_runs_table.php b/database/migrations/2021_06_18_125347_create_hit_and_runs_table.php new file mode 100644 index 00000000..55c7a5e2 --- /dev/null +++ b/database/migrations/2021_06_18_125347_create_hit_and_runs_table.php @@ -0,0 +1,37 @@ +id(); + $table->integer('uid')->index(); + $table->integer('peer_id')->unique(); + $table->integer('torrent_id')->index(); + $table->integer('status')->default(1); + $table->string('comment')->default(''); + $table->timestamp('created_at')->useCurrent(); + $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('hit_and_runs'); + } +}