From 3e102bf57bf42fe5abdc1fc599a21e8d411c2fd2 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 19 Jun 2021 16:49:13 -0700 Subject: [PATCH] Be more specific in accessory query Signed-off-by: snipe --- ..._10_22_233743_move_accessory_checkout_note_to_join_table.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php b/database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php index d2e087d9bd..7ff0b0af8b 100644 --- a/database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php +++ b/database/migrations/2020_10_22_233743_move_accessory_checkout_note_to_join_table.php @@ -51,8 +51,10 @@ class MoveAccessoryCheckoutNoteToJoinTable extends Migration $action_log_entries = Actionlog::where('created_at', '=',$join_log->created_at) ->where('target_id', '=',$join_log->assigned_to) ->where('item_id', '=',$accessory->id) + ->where('item_type', '=','App\\Models\\Accessory') ->where('target_type', '=','App\\Models\\User') ->where('action_type', '=', 'checkout') + ->where('note', '!=', '') ->orderBy('created_at', 'DESC')->get(); \Log::debug($action_log_entries->count().' matching entries in the action_logs table');