public static function getWithDeposit() { $db = new db(); $db_tables = $db->getWpdb(); $proposal = self::addition_fields_list()['deposit']; $users = $db->query("SELECT user_id FROM {$db_tables->usermeta} WHERE {$db_tables->usermeta}.meta_key = '{$proposal}' "); return $users; }
public function getByParentID($id, $type) { $db = new db(); $db_tables = $db->getWpdb(); $stage_fields = $this->addition_fields_list(); $course_field = '_' . $stage_fields['course']; $filtered = array(); $stages = $db->query("SELECT post_id FROM {$db_tables->postmeta} WHERE {$db_tables->postmeta}.meta_key = '{$course_field}' AND {$db_tables->postmeta}.meta_value = '{$id}'"); foreach ($stages as $stage_obj) { if ($type === 'all') { array_push($filtered, $stage_obj->post_id); } elseif (self::stage_place_aviability($stage_obj->post_id)) { array_push($filtered, $stage_obj); } } return $filtered; }