refactor(modular): 完成第二階段儀表板解耦與模型清理
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Successful in 1m1s
Koori-ERP-Deploy-System / deploy-production (push) Has been skipped

This commit is contained in:
2026-01-27 08:59:45 +08:00
parent ac6a81b3d2
commit 0e51992cb4
13 changed files with 140 additions and 52 deletions

View File

@@ -215,15 +215,7 @@ class PurchaseOrderController extends Controller
// 確保有一個有效的使用者 ID
$userId = auth()->id();
if (!$userId) {
$user = \App\Modules\Core\Models\User::first();
if (!$user) {
$user = \App\Modules\Core\Models\User::create([
'name' => '系統管理員',
'email' => 'admin@example.com',
'password' => bcrypt('password'),
]);
}
$userId = $user->id;
$user = $this->coreService->ensureSystemUserExists(); $userId = $user->id;
}
$order = PurchaseOrder::create([