diff --git a/backend/app/Http/Controllers/Client/HomeController.php b/backend/app/Http/Controllers/Client/HomeController.php index d7cc946..6f1326d 100644 --- a/backend/app/Http/Controllers/Client/HomeController.php +++ b/backend/app/Http/Controllers/Client/HomeController.php @@ -56,7 +56,7 @@ class HomeController extends Controller $contract = Contract::withoutGlobalScope('store') ->where('customer_id', $customer->id) ->latest() - ->first(['id', 'contract_no', 'status', 'start_date', 'end_date', 'total_amount']); + ->first(['id', 'contract_no', 'status', 'check_in_date', 'check_out_date', 'total_amount']); // 月嫂信息(进行中派单) $nannyOrder = NannyOrder::withoutGlobalScope('store') diff --git a/backend/database/seeders/DemoClientSeeder.php b/backend/database/seeders/DemoClientSeeder.php index 4768f86..1b658cb 100644 --- a/backend/database/seeders/DemoClientSeeder.php +++ b/backend/database/seeders/DemoClientSeeder.php @@ -75,7 +75,7 @@ class DemoClientSeeder extends Seeder [6, 36.8, '℃'], [1, 36.4, '℃'], [2, 57.9, 'kg'], - [3, '110/70', 'mmHg'], + [3, 110, 'mmHg'], [5, 3.72, 'kg'], ]; foreach ($metricData as $i => [$type, $value, $unit]) { @@ -84,7 +84,7 @@ class DemoClientSeeder extends Seeder 'metric_type' => $type, 'value' => $value, 'unit' => $unit, - 'measured_at' => now()->subDays((int)($i / 2))->setHour(8 + $i % 3), + 'recorded_at' => now()->subDays((int)($i / 2))->setHour(8 + $i % 3), 'created_at' => now()->subDays((int)($i / 2)), ]); } @@ -225,26 +225,24 @@ class DemoClientSeeder extends Seeder // ── 9. 投诉反馈 ─────────────────────────────────────────────────────── DB::table('complaints')->insert([ - [ - 'store_id' => $storeId, - 'customer_id' => $customerId, - 'type' => 1, - 'content' => '昨晚空调温度偏低,宝宝有点凉,希望能保持在26度左右', - 'status' => 2, - 'handle_result' => '已通知客房调整空调,确保室温维持在25-26℃,感谢您的反馈!', - 'handle_at' => now()->subDays(1), - 'created_at' => now()->subDays(2), - 'updated_at' => now()->subDays(1), - ], - [ - 'store_id' => $storeId, - 'customer_id' => $customerId, - 'type' => 2, - 'content' => '今日午餐的汤偏咸,建议减少盐量,产后饮食应清淡', - 'status' => 1, - 'created_at' => now()->subHours(5), - 'updated_at' => now()->subHours(5), - ], + 'store_id' => $storeId, + 'customer_id' => $customerId, + 'type' => 1, + 'content' => '昨晚空调温度偏低,宝宝有点凉,希望能保持在26度左右', + 'status' => 2, + 'handle_result' => '已通知客房调整空调,确保室温维持在25-26℃,感谢您的反馈!', + 'handle_at' => now()->subDays(1), + 'created_at' => now()->subDays(2), + 'updated_at' => now()->subDays(1), + ]); + DB::table('complaints')->insert([ + 'store_id' => $storeId, + 'customer_id' => $customerId, + 'type' => 2, + 'content' => '今日午餐的汤偏咸,建议减少盐量,产后饮食应清淡', + 'status' => 1, + 'created_at' => now()->subHours(5), + 'updated_at' => now()->subHours(5), ]); $this->command->info("✅ Demo 客户创建成功!");