Browse Source

add PaliText PageNumber

visuddhinanda 2 years ago
parent
commit
d966f151b7
1 changed files with 12 additions and 0 deletions
  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\FtsText;
 use App\Models\WbwTemplate;
 use App\Models\WbwTemplate;
 use App\Models\BookTitle;
 use App\Models\BookTitle;
+use App\Models\PaliText;
+use App\Models\PageNumber;
 
 
 class UpgradePcdBookId extends Command
 class UpgradePcdBookId extends Command
 {
 {
@@ -58,6 +60,16 @@ class UpgradePcdBookId extends Command
                     ->where('paragraph','>=',$value->paragraph)
                     ->where('paragraph','>=',$value->paragraph)
                     ->update(['pcd_book_id'=>$value->sn]);
                     ->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->advance();
         }
         }
         $bar->finish();
         $bar->finish();