Skip to content

Commit 7baff21

Browse files
committed
Changed where clause variable name
1 parent 1f2232b commit 7baff21

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

classes/Utils.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4270,16 +4270,16 @@ public function get_reviews_by_instructor( $instructor_id = 0, $offset = 0, $lim
42704270
$date_filter = sanitize_text_field( $date_filter );
42714271
$instructor_id = $this->get_user_id( $instructor_id );
42724272

4273-
$course_query = '';
4274-
$date_query = '';
4275-
$where_clause = '';
4273+
$course_query = '';
4274+
$date_query = '';
4275+
$review_date_clause = '';
42764276

42774277
if ( ! empty( $args['from'] ) && ! empty( $args['to'] ) ) {
42784278
$from = Input::sanitize( $args['from'] );
42794279
$to = Input::sanitize( $args['to'] );
42804280

42814281
$where['comment_date'] = array( 'BETWEEN', array( $from, $to ) );
4282-
$where_clause = ' AND ' . QueryHelper::prepare_where_clause( $where );
4282+
$review_date_clause = ' AND ' . QueryHelper::prepare_where_clause( $where );
42834283
}
42844284

42854285
if ( '' !== $course_id ) {
@@ -4312,7 +4312,7 @@ public function get_reviews_by_instructor( $instructor_id = 0, $offset = 0, $lim
43124312
WHERE {$wpdb->comments}.comment_post_ID IN({$implode_ids})
43134313
AND comment_type = %s
43144314
AND meta_key = %s
4315-
{$where_clause}
4315+
{$review_date_clause}
43164316
{$course_query}
43174317
{$date_query}
43184318
",
@@ -4346,7 +4346,7 @@ public function get_reviews_by_instructor( $instructor_id = 0, $offset = 0, $lim
43464346
WHERE {$wpdb->comments}.comment_post_ID IN({$implode_ids})
43474347
AND comment_type = %s
43484348
AND meta_key = %s
4349-
{$where_clause}
4349+
{$review_date_clause}
43504350
{$course_query}
43514351
{$date_query}
43524352
ORDER BY {$order_by} DESC

models/WithdrawModel.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ class WithdrawModel {
3939
public static function get_withdraw_summary( $instructor_id, $args = array() ) {
4040
global $wpdb;
4141

42-
$args = tutor_utils()->sanitize_array( $args );
43-
$where_clause = '';
42+
$args = tutor_utils()->sanitize_array( $args );
43+
$date_clause = '';
4444

4545
if ( ! empty( $args['from'] ) && ! empty( $args['to'] ) ) {
4646
$from = Input::sanitize( $args['from'] );
4747
$to = Input::sanitize( $args['to'] );
4848

4949
$where['created_at'] = array( 'BETWEEN', array( $from, $to ) );
50-
$where_clause = ' AND ' . QueryHelper::prepare_where_clause( $where );
50+
$date_clause = ' AND ' . QueryHelper::prepare_where_clause( $where );
5151
}
5252

5353
$maturity_days = tutor_utils()->get_option( 'minimum_days_for_balance_to_be_available' );
@@ -65,25 +65,25 @@ public static function get_withdraw_summary( $instructor_id, $args = array() ) {
6565
6666
FROM (
6767
SELECT ID,display_name,
68-
COALESCE((SELECT SUM(instructor_amount) FROM {$wpdb->prefix}tutor_earnings WHERE order_status='%s' {$where_clause} GROUP BY user_id HAVING user_id=u.ID),0) total_income,
68+
COALESCE((SELECT SUM(instructor_amount) FROM {$wpdb->prefix}tutor_earnings WHERE order_status='%s' {$date_clause} GROUP BY user_id HAVING user_id=u.ID),0) total_income,
6969
7070
COALESCE((
7171
SELECT sum(amount) total_withdraw FROM {$wpdb->prefix}tutor_withdraws
72-
WHERE status='%s' {$where_clause}
72+
WHERE status='%s' {$date_clause}
7373
GROUP BY user_id
7474
HAVING user_id=u.ID
7575
),0) total_withdraw,
7676
7777
COALESCE((
7878
SELECT sum(amount) total_pending FROM {$wpdb->prefix}tutor_withdraws
79-
WHERE status='pending' {$where_clause}
79+
WHERE status='pending' {$date_clause}
8080
GROUP BY user_id
8181
HAVING user_id=u.ID
8282
),0) total_pending,
8383
8484
COALESCE((
8585
SELECT SUM(instructor_amount) FROM(
86-
SELECT user_id, instructor_amount, created_at, DATEDIFF(NOW(),created_at) AS days_old FROM {$wpdb->prefix}tutor_earnings WHERE order_status='%s' {$where_clause}
86+
SELECT user_id, instructor_amount, created_at, DATEDIFF(NOW(),created_at) AS days_old FROM {$wpdb->prefix}tutor_earnings WHERE order_status='%s' {$date_clause}
8787
) a
8888
WHERE days_old >= %d
8989
GROUP BY user_id

0 commit comments

Comments
 (0)