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

This commit is contained in:
allen.yan 2025-06-16 21:20:24 +08:00
parent 41380c5c84
commit bbb3f8dbda
3 changed files with 4 additions and 4 deletions

View File

@ -46,7 +46,6 @@ class ExportSqliteBranchJob implements ShouldQueue
$exporter->exportMultiple([
'branches' => [
'modelClass' => Branch::class,
'query' => fn () => Branch::where('id', $this->branchId)->get(),
'tableSchema' => function ($table) {
$table->id();
@ -65,7 +64,6 @@ class ExportSqliteBranchJob implements ShouldQueue
],
],
'rooms' => [
'modelClass' => Room::class,
'query' => fn () => Room::where('branch_id', $this->branchId)->get(),
'tableSchema' => function ($table) {
$table->id();

View File

@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Model;
class RoomStatusLog extends Model
{
/** @use HasFactory<\Database\Factories\ArtistFactory> */
use HasFactory;
public $timestamps = true;
@ -23,8 +22,11 @@ class RoomStatusLog extends Model
protected $casts = [
'status' => \App\Enums\RoomStatus::class,
];
public function user(){
return $this->belongsTo(User::class);
}
public function room() {
return $this->belongsTo(Room::class);
}
}

BIN
database/.DS_Store vendored

Binary file not shown.