Be more specific in accessory query

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2021-06-19 16:49:13 -07:00
parent cdcb153b1e
commit 3e102bf57b

View file

@ -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');