Code Duplication    Length = 4-4 lines in 2 locations

core/db_models/EEM_Registration.model.php 2 locations

@@ 330-333 (lines=4) @@
327
		$inner_date_query = "SELECT DISTINCT REG_date from $registration_table ";
328
		$inner_where = " WHERE";
329
		//exclude events not authored by user if permissions in effect
330
		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
331
			$inner_date_query .= "LEFT JOIN $event_table ON ID = EVT_ID";
332
			$inner_where .= " post_author = " . get_current_user_id() . " AND";
333
		}
334
		$inner_where .= " REG_date >= '$sql_date'";
335
		$inner_date_query .= $inner_where;
336
@@ 425-428 (lines=4) @@
422
		$inner_date_query = "SELECT DISTINCT EVT_ID, REG_date from $registration_table ";
423
		$inner_where = " WHERE";
424
		//exclude events not authored by user if permissions in effect
425
		if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_others_registrations', 'reg_per_event_report' ) ) {
426
			$inner_date_query .= "LEFT JOIN $event_table ON ID = EVT_ID";
427
			$inner_where .= " post_author = " . get_current_user_id() . " AND";
428
		}
429
		$inner_where .= " REG_date >= '$sql_date'";
430
		$inner_date_query .= $inner_where;
431