more query fixes
This commit is contained in:
parent
12dfac7288
commit
aa909bebf4
@ -80,7 +80,7 @@ class Cockpit_Bounce_Back extends Cana_Table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function checkBoundWasSent( $id_user, $id_order, $rule ){
|
public function checkBoundWasSent( $id_user, $id_order, $rule ){
|
||||||
$bounce = Cockpit_Bounce_Back::q( 'SELECT * FROM bounce_back WHERE id_user = "' . $id_user . '" AND id_order = "' . $id_order . '" AND rule = "' . $rule . '" ORDER BY id_bounce_back DESC LIMIT 1' );
|
$bounce = Cockpit_Bounce_Back::q( 'SELECT * FROM bounce_back WHERE id_user = ? AND id_order = ? AND rule = ? ORDER BY id_bounce_back DESC LIMIT 1', [$id_user, $id_order, $rule]);
|
||||||
if( $bounce->id_bounce_back ){
|
if( $bounce->id_bounce_back ){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class Crunchbutton_User_Payment_Type extends Cana_Table {
|
|||||||
$id_user = ( $id_user ) ? $id_user : c::user()->id_user;
|
$id_user = ( $id_user ) ? $id_user : c::user()->id_user;
|
||||||
if( $id_user ){
|
if( $id_user ){
|
||||||
$where = ' AND ' . Crunchbutton_User_Payment_Type::processor() . '_id IS NOT NULL';
|
$where = ' AND ' . Crunchbutton_User_Payment_Type::processor() . '_id IS NOT NULL';
|
||||||
$payment = Crunchbutton_User_Payment_Type::q( 'SELECT * FROM user_payment_type WHERE id_user = "' . $id_user . '" AND active = true ' . $where . ' ORDER BY id_user_payment_type DESC LIMIT 1' );
|
$payment = Crunchbutton_User_Payment_Type::q( 'SELECT * FROM user_payment_type WHERE id_user = ? AND active = true ' . $where . ' ORDER BY id_user_payment_type DESC LIMIT 1', [$id_user]);
|
||||||
if( $payment->id_user_payment_type ){
|
if( $payment->id_user_payment_type ){
|
||||||
return $payment;
|
return $payment;
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ class Crunchbutton_User_Payment_Type extends Cana_Table {
|
|||||||
if (!$this->id_user || !$this->id_user_payment_type) {
|
if (!$this->id_user || !$this->id_user_payment_type) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
self::q('select * from user_payment_type where id_user="'.$this->id_user.'" and id_user_payment_type!= "'.$this->id_user_payment_type.'"')->each(function() {
|
self::q('select * from user_payment_type where id_user=? and id_user_payment_type!= ?', [$this->id_user, $this->id_user_payment_type])->each(function() {
|
||||||
$this->deactivate();
|
$this->deactivate();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user