瀏覽代碼

add PaliText PageNumber

visuddhinanda 2 年之前
父節點
當前提交
d966f151b7
共有 1 個文件被更改,包括 12 次插入0 次删除
  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();