LLMS_Analytics_Registrations_Widget::set_query()


Source Source

File: includes/admin/reporting/widgets/class.llms.analytics.widget.registrations.php

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
public function set_query() {
 
    global $wpdb;
 
    $dates = $this->get_posted_dates();
 
    $student_ids = '';
    $students    = $this->get_posted_students();
    if ( $students ) {
        $student_ids .= 'AND ID IN ( ' . implode( ', ', $students ) . ' )';
    }
 
    $this->query_function = 'get_results';
    $this->output_type    = OBJECT;
 
    $this->query = "SELECT user_registered AS date
                    FROM {$wpdb->users}
                    WHERE
                        user_registered BETWEEN CAST( %s AS DATETIME ) AND CAST( %s AS  DATETIME )
                        {$student_ids}
                    ;";
 
    $this->query_vars = array(
        $this->format_date( $dates['start'], 'start' ),
        $this->format_date( $dates['end'], 'end' ),
    );
 
}

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.