My answer
public static function load($entry = array()) {
$maxDate = \Drupal::request()->query->get('set_start_date');
$minDate = \Drupal::request()->query->get('set_end_date');
$select = db_select('pastpayments', 'x');
$select->fields('x');
$select->condition('paiddate', array($maxDate, $minDate), 'BETWEEN');
$ans=$select->execute()->fetchAll();
return $ans;
}