LLMS_Voucher::get_voucher_codes( string $format = 'OBJECT' )
Get a list of voucher codes
Parameters Parameters
- $format
-
(string) (Optional) Return format.
Default value: 'OBJECT'
Return Return
(array)
Source Source
File: includes/class.llms.voucher.php
public function get_voucher_codes( $format = 'OBJECT' ) { global $wpdb; $table = $this->get_codes_table_name(); $redeemed_table = $this->get_redemptions_table_name(); $query = "SELECT c.*, count(r.id) as used FROM $table as c LEFT JOIN $redeemed_table as r ON c.`id` = r.`code_id` WHERE `voucher_id` = $this->id AND `is_deleted` = 0 GROUP BY c.id"; return $wpdb->get_results( $query, $format ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |