Skip to content

Commit e53d18c

Browse files
committed
rewriting the query to be on a single line
1 parent 23944cc commit e53d18c

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/api.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,7 @@ function api_buy_license($sid, $ip, $type, $coupon = '', $use_prepay = null)
249249
// coupon code
250250
if ($coupon != '') {
251251
$couponquery = <<<SQL
252-
select * from coupons where
253-
(customer=-1 or customer={$custid}) and
254-
(usable != 0) and module='{$module}' and
255-
(applies=-1 or applies like '%,{$type},%' or applies='{$type}' or applies like '{$type},%' or applies like '%,{$type}') and
256-
(name='{$coupon}')
252+
select * from coupons where (customer=-1 or customer={$custid}) and (usable != 0) and module='{$module}' and (applies=-1 or applies like '%,{$type},%' or applies='{$type}' or applies like '{$type},%' or applies like '%,{$type}') and (name='{$coupon}')
257253
SQL;
258254
$db->query($couponquery, __LINE__, __FILE__);
259255
if ($db->num_rows() == 0) {

0 commit comments

Comments
 (0)