包廂同步 原同步包廂資訊 改全部同步 20250604
This commit is contained in:
parent
42bf78df8c
commit
25652b0f57
@ -19,6 +19,13 @@ class ExportSqliteFavoriteJob implements ShouldQueue
|
|||||||
|
|
||||||
public $timeout = 600; // 可依資料量調整 timeout 秒數
|
public $timeout = 600; // 可依資料量調整 timeout 秒數
|
||||||
|
|
||||||
|
protected ?int $branchId;
|
||||||
|
|
||||||
|
public function __construct(?int $branchId = null)
|
||||||
|
{
|
||||||
|
$this->branchId = $branchId;
|
||||||
|
}
|
||||||
|
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$sqlitePath = storage_path('app/database/tempFavorite.sqlite');
|
$sqlitePath = storage_path('app/database/tempFavorite.sqlite');
|
||||||
@ -57,6 +64,6 @@ class ExportSqliteFavoriteJob implements ShouldQueue
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
SendSqliteFileJob::dispatch($sqlitePath);
|
SendSqliteFileJob::dispatch($sqlitePath, $this->branchId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,13 @@ class ExportSqliteSongJob implements ShouldQueue
|
|||||||
|
|
||||||
public $timeout = 600; // 可依資料量調整 timeout 秒數
|
public $timeout = 600; // 可依資料量調整 timeout 秒數
|
||||||
|
|
||||||
|
protected ?int $branchId;
|
||||||
|
|
||||||
|
public function __construct(?int $branchId = null)
|
||||||
|
{
|
||||||
|
$this->branchId = $branchId;
|
||||||
|
}
|
||||||
|
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$sqlitePath = storage_path('app/database/tempSong.sqlite');
|
$sqlitePath = storage_path('app/database/tempSong.sqlite');
|
||||||
@ -145,6 +152,6 @@ class ExportSqliteSongJob implements ShouldQueue
|
|||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
DB::purge($connectionName);
|
DB::purge($connectionName);
|
||||||
SendSqliteFileJob::dispatch($sqlitePath);
|
SendSqliteFileJob::dispatch($sqlitePath, $this->branchId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,9 +21,11 @@ class ExportSqliteUserJob implements ShouldQueue
|
|||||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
public $timeout = 600; // 可依資料量調整 timeout 秒數
|
public $timeout = 600; // 可依資料量調整 timeout 秒數
|
||||||
|
protected ?int $branchId;
|
||||||
public bool $isSend;
|
public bool $isSend;
|
||||||
public function __construct(bool $isSend = true){
|
public function __construct(bool $isSend = true,?int $branchId = null){
|
||||||
$this->isSend =$isSend ;
|
$this->isSend =$isSend ;
|
||||||
|
$this->branchId = $branchId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle()
|
public function handle()
|
||||||
@ -209,7 +211,7 @@ class ExportSqliteUserJob implements ShouldQueue
|
|||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
if($this->isSend)
|
if($this->isSend)
|
||||||
SendSqliteFileJob::dispatch($sqlitePath);
|
SendSqliteFileJob::dispatch($sqlitePath, $this->branchId);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,9 @@ namespace App\Livewire\Admin;
|
|||||||
|
|
||||||
use App\Models\Branch;
|
use App\Models\Branch;
|
||||||
use App\Jobs\ExportSqliteBranchJob;
|
use App\Jobs\ExportSqliteBranchJob;
|
||||||
|
use App\Jobs\ExportSqliteUserJob;
|
||||||
|
use App\Jobs\ExportSqliteSongJob;
|
||||||
|
use App\Jobs\ExportSqliteFavoriteJob;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
@ -130,6 +133,10 @@ final class BranchTable extends PowerGridComponent
|
|||||||
public function synchronous($branch_id): void
|
public function synchronous($branch_id): void
|
||||||
{
|
{
|
||||||
ExportSqliteBranchJob::dispatch($branch_id);
|
ExportSqliteBranchJob::dispatch($branch_id);
|
||||||
|
ExportSqliteSongJob::dispatch($branch_id);
|
||||||
|
ExportSqliteFavoriteJob::dispatch($branch_id);
|
||||||
|
ExportSqliteUserJob::dispatch(true,$branch_id);
|
||||||
|
|
||||||
$this->notification()->send([
|
$this->notification()->send([
|
||||||
'icon' => 'success',
|
'icon' => 'success',
|
||||||
'title' => '分店:'.$branch_id,
|
'title' => '分店:'.$branch_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user