調整 同步Branch 資料會全部到分店去的問題 v1 20250616

This commit is contained in:
allen.yan 2025-06-16 22:23:08 +08:00
parent bbb3f8dbda
commit cf1ea1f081

View File

@ -46,7 +46,7 @@ class ExportSqliteBranchJob implements ShouldQueue
$exporter->exportMultiple([
'branches' => [
'query' => fn () => Branch::where('id', $this->branchId)->get(),
'query' => fn () => Branch::where('id', $this->branchId),
'tableSchema' => function ($table) {
$table->id();
$table->string('name')->comment('店名');
@ -64,7 +64,7 @@ class ExportSqliteBranchJob implements ShouldQueue
],
],
'rooms' => [
'query' => fn () => Room::where('branch_id', $this->branchId)->get(),
'query' => fn () => Room::where('branch_id', $this->branchId),
'tableSchema' => function ($table) {
$table->id();
$table->unsignedBigInteger('branch_id')->comment('關聯分店');