調整 同步Branch 資料會全部到分店去的問題 20250616
This commit is contained in:
parent
41380c5c84
commit
bbb3f8dbda
@ -46,7 +46,6 @@ class ExportSqliteBranchJob implements ShouldQueue
|
|||||||
|
|
||||||
$exporter->exportMultiple([
|
$exporter->exportMultiple([
|
||||||
'branches' => [
|
'branches' => [
|
||||||
'modelClass' => Branch::class,
|
|
||||||
'query' => fn () => Branch::where('id', $this->branchId)->get(),
|
'query' => fn () => Branch::where('id', $this->branchId)->get(),
|
||||||
'tableSchema' => function ($table) {
|
'tableSchema' => function ($table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
@ -65,7 +64,6 @@ class ExportSqliteBranchJob implements ShouldQueue
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
'rooms' => [
|
'rooms' => [
|
||||||
'modelClass' => Room::class,
|
|
||||||
'query' => fn () => Room::where('branch_id', $this->branchId)->get(),
|
'query' => fn () => Room::where('branch_id', $this->branchId)->get(),
|
||||||
'tableSchema' => function ($table) {
|
'tableSchema' => function ($table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
|
@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class RoomStatusLog extends Model
|
class RoomStatusLog extends Model
|
||||||
{
|
{
|
||||||
/** @use HasFactory<\Database\Factories\ArtistFactory> */
|
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
@ -23,8 +22,11 @@ class RoomStatusLog extends Model
|
|||||||
protected $casts = [
|
protected $casts = [
|
||||||
'status' => \App\Enums\RoomStatus::class,
|
'status' => \App\Enums\RoomStatus::class,
|
||||||
];
|
];
|
||||||
|
public function user(){
|
||||||
|
return $this->belongsTo(User::class);
|
||||||
|
}
|
||||||
public function room() {
|
public function room() {
|
||||||
return $this->belongsTo(Room::class);
|
return $this->belongsTo(Room::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
BIN
database/.DS_Store
vendored
BIN
database/.DS_Store
vendored
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user