fix remove claim

This commit is contained in:
xiaomlove
2022-05-07 15:10:14 +08:00
parent 42bc88e53a
commit 0d154242f2
3 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ class ClaimRepository extends BaseRepository
public function delete($id, $uid) public function delete($id, $uid)
{ {
$isEnabled = Claim::getConfigIsEnabled(); $isEnabled = Claim::getConfigIsEnabled();
if ($isEnabled) { if (!$isEnabled) {
throw new \RuntimeException(nexus_trans("torrent.claim_disabled")); throw new \RuntimeException(nexus_trans("torrent.claim_disabled"));
} }
$model = Claim::query()->findOrFail($id); $model = Claim::query()->findOrFail($id);
@@ -13,6 +13,9 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
if (Schema::hasTable('complains')) {
return;
}
Schema::create('complains', function (Blueprint $table) { Schema::create('complains', function (Blueprint $table) {
$table->id(); $table->id();
$table->char('uuid', 36); $table->char('uuid', 36);
@@ -13,6 +13,9 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
if (Schema::hasTable('complain_replies')) {
return;
}
Schema::create('complain_replies', function (Blueprint $table) { Schema::create('complain_replies', function (Blueprint $table) {
$table->id(); $table->id();
$table->integer('complain'); $table->integer('complain');