Przeglądaj źródła

add PaliText PageNumber

visuddhinanda 2 lat temu
rodzic
commit
d966f151b7
1 zmienionych plików z 12 dodań i 0 usunięć
  1. 12 0
      app/Console/Commands/UpgradePcdBookId.php

+ 12 - 0
app/Console/Commands/UpgradePcdBookId.php

@@ -6,6 +6,8 @@ use Illuminate\Console\Command;
 use App\Models\FtsText;
 use App\Models\WbwTemplate;
 use App\Models\BookTitle;
+use App\Models\PaliText;
+use App\Models\PageNumber;
 
 class UpgradePcdBookId extends Command
 {
@@ -58,6 +60,16 @@ class UpgradePcdBookId extends Command
                     ->where('paragraph','>=',$value->paragraph)
                     ->update(['pcd_book_id'=>$value->sn]);
             }
+            if($table === 'all' || $table ==='pali_text'){
+                PaliText::where('book',$value->book)
+                    ->where('paragraph','>=',$value->paragraph)
+                    ->update(['pcd_book_id'=>$value->sn]);
+            }
+            if($table === 'all' || $table ==='page_number'){
+                PageNumber::where('book',$value->book)
+                    ->where('paragraph','>=',$value->paragraph)
+                    ->update(['pcd_book_id'=>$value->sn]);
+            }
             $bar->advance();
         }
         $bar->finish();