|
@@ -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
|
|
|
{
|
|
{
|
|
@@ -51,12 +53,22 @@ class UpgradePcdBookId extends Command
|
|
|
if($table === 'all' || $table ==='fts'){
|
|
if($table === 'all' || $table ==='fts'){
|
|
|
FtsText::where('book',$value->book)
|
|
FtsText::where('book',$value->book)
|
|
|
->where('paragraph','>=',$value->paragraph)
|
|
->where('paragraph','>=',$value->paragraph)
|
|
|
- ->update(['pcd_book_id'=>$value->id]);
|
|
|
|
|
|
|
+ ->update(['pcd_book_id'=>$value->sn]);
|
|
|
}
|
|
}
|
|
|
if($table === 'all' || $table ==='wbw'){
|
|
if($table === 'all' || $table ==='wbw'){
|
|
|
WbwTemplate::where('book',$value->book)
|
|
WbwTemplate::where('book',$value->book)
|
|
|
->where('paragraph','>=',$value->paragraph)
|
|
->where('paragraph','>=',$value->paragraph)
|
|
|
- ->update(['pcd_book_id'=>$value->id]);
|
|
|
|
|
|
|
+ ->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();
|
|
|
}
|
|
}
|