Hello once again I have added a custom field to Prestashop customer object, so I have modified the customer table and added the possibility to edit this custom field from Prestashop's backend. I need to fetch the new data from the new custom field and put it in the 'id_customer' field of this module that I've modified some days ago with the priceless help of Michael Eugene Yuen.
Look at this pastebin at line 203 and 1273.
array("name" => "codice target", "field" => "codice_target", "database" => "customer", "alias" => "c"), //aggiunto codice target
//scambio l'id customer con il codice_target
//$readyForExport['codice_target'] = 8989;
$textTarget = (string)$readyForExport['codice_target'];
$readyForExport['id_customer'] = $textTarget;
This is my array result for now in the debug command at line 1248.
array(14) { ["id_customer"]=> string(2) "72" ["date_add"]=> string(19) "2018-02-08 18:54:25" ["product_name"]=> string(45) "ATS - Colore Rivestimento : PPL Atenea Bianco" ["product_quantity"]=> string(1) "6" ["invoice_date"]=> string(19) "2018-02-08 18:54:27" ["delivery_date"]=> string(19) "2018-02-08 18:54:27" ["id_order"]=> string(3) "240" ["reference"]=> string(9) "UVNHBJJAC" ["delivery_number"]=> string(2) "43" ["product_id"]=> string(3) "209" ["product_reference"]=> string(8) "ATENEA S" ["product_price"]=> string(9) "90.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(1) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-14 14:52:13" ["product_name"]=> string(57) "CAP - Colore Rivestimento : I No Flame colore ROSSO -- IR" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-14 14:56:19" ["delivery_date"]=> string(19) "2018-02-14 14:56:21" ["id_order"]=> string(3) "241" ["reference"]=> string(9) "DDIHNQAHE" ["delivery_number"]=> string(2) "44" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "660.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(1) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-14 14:52:13" ["product_name"]=> string(64) "CAP - Colore Rivestimento : I Bondai no flame colore ROSSO -- SR" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-14 14:56:19" ["delivery_date"]=> string(19) "2018-02-14 14:56:21" ["id_order"]=> string(3) "241" ["reference"]=> string(9) "DDIHNQAHE" ["delivery_number"]=> string(2) "44" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "670.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(2) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-14 14:52:13" ["product_name"]=> string(57) "CAP - Colore Rivestimento : E Ecopelle colore ROSSO -- KR" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-14 14:56:19" ["delivery_date"]=> string(19) "2018-02-14 14:56:21" ["id_order"]=> string(3) "241" ["reference"]=> string(9) "DDIHNQAHE" ["delivery_number"]=> string(2) "44" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "660.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(3) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-14 14:52:13" ["product_name"]=> string(72) "CAP - Colore Rivestimento : S Target TG 1011 ignifugo colore ROSSO -- TR" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-14 14:56:19" ["delivery_date"]=> string(19) "2018-02-14 14:56:21" ["id_order"]=> string(3) "241" ["reference"]=> string(9) "DDIHNQAHE" ["delivery_number"]=> string(2) "44" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "680.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(4) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-14 14:52:13" ["product_name"]=> string(62) "CAP - Colore Rivestimento : S Expo ignifugo colore ROSSO -- XR" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-14 14:56:19" ["delivery_date"]=> string(19) "2018-02-14 14:56:21" ["id_order"]=> string(3) "241" ["reference"]=> string(9) "DDIHNQAHE" ["delivery_number"]=> string(2) "44" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "680.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(5) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-14 14:52:13" ["product_name"]=> string(41) "CAP - Colore Rivestimento : P Pelle -- PA" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-14 14:56:19" ["delivery_date"]=> string(19) "2018-02-14 14:56:21" ["id_order"]=> string(3) "241" ["reference"]=> string(9) "DDIHNQAHE" ["delivery_number"]=> string(2) "44" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "700.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(6) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-14 15:07:11" ["product_name"]=> string(67) "CAP - Colore Rivestimento : I Bondai no flame colore BORDEAUX - SRB" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-14 15:11:14" ["delivery_date"]=> string(19) "2018-02-14 15:11:15" ["id_order"]=> string(3) "242" ["reference"]=> string(9) "OEEOUPLLS" ["delivery_number"]=> string(2) "45" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "670.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(1) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-14 15:07:11" ["product_name"]=> string(61) "CAP - Colore Rivestimento : E Ecopelle colore BLU SCURO - KBS" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-14 15:11:14" ["delivery_date"]=> string(19) "2018-02-14 15:11:15" ["id_order"]=> string(3) "242" ["reference"]=> string(9) "OEEOUPLLS" ["delivery_number"]=> string(2) "45" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "720.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(2) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-14 15:07:11" ["product_name"]=> string(78) "CAP - Colore Rivestimento : S King KING-L ignifuco colore VERDE MILITARE - LVM" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-14 15:11:14" ["delivery_date"]=> string(19) "2018-02-14 15:11:15" ["id_order"]=> string(3) "242" ["reference"]=> string(9) "OEEOUPLLS" ["delivery_number"]=> string(2) "45" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "680.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(3) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-15 15:35:33" ["product_name"]=> string(57) "EPP - Colore Rivestimento : I No Flame colore ROSSO -- IR" ["product_quantity"]=> string(1) "2" ["invoice_date"]=> string(19) "2018-02-15 15:39:39" ["delivery_date"]=> string(19) "2018-02-15 15:39:39" ["id_order"]=> string(3) "243" ["reference"]=> string(9) "GZSIDBAPV" ["delivery_number"]=> string(2) "46" ["product_id"]=> string(3) "496" ["product_reference"]=> string(9) "EUTERPE P" ["product_price"]=> string(10) "140.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(1) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-15 15:35:33" ["product_name"]=> string(61) "EPP - Colore Rivestimento : F Fili di Luce colore ROSSO - F15" ["product_quantity"]=> string(1) "2" ["invoice_date"]=> string(19) "2018-02-15 15:39:39" ["delivery_date"]=> string(19) "2018-02-15 15:39:39" ["id_order"]=> string(3) "243" ["reference"]=> string(9) "GZSIDBAPV" ["delivery_number"]=> string(2) "46" ["product_id"]=> string(3) "496" ["product_reference"]=> string(9) "EUTERPE P" ["product_price"]=> string(10) "140.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(2) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-15 15:35:33" ["product_name"]=> string(79) "EPP - Colore Rivestimento : S Target TG 1013 ignifugo colore VERDE CHIARO - TVC" ["product_quantity"]=> string(1) "2" ["invoice_date"]=> string(19) "2018-02-15 15:39:39" ["delivery_date"]=> string(19) "2018-02-15 15:39:39" ["id_order"]=> string(3) "243" ["reference"]=> string(9) "GZSIDBAPV" ["delivery_number"]=> string(2) "46" ["product_id"]=> string(3) "496" ["product_reference"]=> string(9) "EUTERPE P" ["product_price"]=> string(10) "150.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(3) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-15 15:35:33" ["product_name"]=> string(78) "EPP - Colore Rivestimento : S King KING-L ignifuco colore VERDE MILITARE - LVM" ["product_quantity"]=> string(1) "3" ["invoice_date"]=> string(19) "2018-02-15 15:39:39" ["delivery_date"]=> string(19) "2018-02-15 15:39:39" ["id_order"]=> string(3) "243" ["reference"]=> string(9) "GZSIDBAPV" ["delivery_number"]=> string(2) "46" ["product_id"]=> string(3) "496" ["product_reference"]=> string(9) "EUTERPE P" ["product_price"]=> string(10) "150.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(4) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-15 16:28:47" ["product_name"]=> string(63) "EPD - Colore Rivestimento : F Fili di Luce colore RUGGINE - F35" ["product_quantity"]=> string(1) "2" ["invoice_date"]=> string(19) "2018-02-15 16:32:50" ["delivery_date"]=> string(19) "2018-02-15 16:32:51" ["id_order"]=> string(3) "244" ["reference"]=> string(9) "CMQAUMRNL" ["delivery_number"]=> string(2) "47" ["product_id"]=> string(3) "497" ["product_reference"]=> string(9) "EUTERPE D" ["product_price"]=> string(10) "130.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(1) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-15 16:28:47" ["product_name"]=> string(71) "EPD - Colore Rivestimento : S King KING-L ignifuco colore RUGGINE - LRU" ["product_quantity"]=> string(1) "2" ["invoice_date"]=> string(19) "2018-02-15 16:32:50" ["delivery_date"]=> string(19) "2018-02-15 16:32:51" ["id_order"]=> string(3) "244" ["reference"]=> string(9) "CMQAUMRNL" ["delivery_number"]=> string(2) "47" ["product_id"]=> string(3) "497" ["product_reference"]=> string(9) "EUTERPE D" ["product_price"]=> string(10) "140.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(2) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-15 17:00:57" ["product_name"]=> string(70) "CAP - Colore Rivestimento : I Bondai no flame colore VERDE SCURO - SVS" ["product_quantity"]=> string(1) "2" ["invoice_date"]=> string(19) "2018-02-15 17:05:00" ["delivery_date"]=> string(19) "2018-02-15 17:05:00" ["id_order"]=> string(3) "245" ["reference"]=> string(9) "APVFQNWHP" ["delivery_number"]=> string(2) "48" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "335.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(1) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-15 17:00:57" ["product_name"]=> string(78) "CAP - Colore Rivestimento : S King KING-L ignifuco colore VERDE MILITARE - LVM" ["product_quantity"]=> string(1) "2" ["invoice_date"]=> string(19) "2018-02-15 17:05:00" ["delivery_date"]=> string(19) "2018-02-15 17:05:00" ["id_order"]=> string(3) "245" ["reference"]=> string(9) "APVFQNWHP" ["delivery_number"]=> string(2) "48" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "340.000000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(2) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-27 12:29:09" ["product_name"]=> string(58) "SISY - Colore Rivestimento : I No Flame colore ROSSO -- IR" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-27 12:33:15" ["delivery_date"]=> string(19) "2018-02-27 12:33:16" ["id_order"]=> string(3) "246" ["reference"]=> string(9) "EZDOUNQFE" ["delivery_number"]=> string(2) "49" ["product_id"]=> string(3) "690" ["product_reference"]=> string(9) "SIMPLE SY" ["product_price"]=> string(9) "55.510000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(1) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-27 12:29:09" ["product_name"]=> string(67) "SISY - Colore Rivestimento : I Bondai no flame colore CELESTE - SCB" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-27 12:33:15" ["delivery_date"]=> string(19) "2018-02-27 12:33:16" ["id_order"]=> string(3) "246" ["reference"]=> string(9) "EZDOUNQFE" ["delivery_number"]=> string(2) "49" ["product_id"]=> string(3) "690" ["product_reference"]=> string(9) "SIMPLE SY" ["product_price"]=> string(9) "55.510000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(2) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-27 12:29:09" ["product_name"]=> string(51) "SISY - Colore Rivestimento : E Eco colore BLU -- EB" ["product_quantity"]=> string(1) "2" ["invoice_date"]=> string(19) "2018-02-27 12:33:15" ["delivery_date"]=> string(19) "2018-02-27 12:33:16" ["id_order"]=> string(3) "246" ["reference"]=> string(9) "EZDOUNQFE" ["delivery_number"]=> string(2) "49" ["product_id"]=> string(3) "690" ["product_reference"]=> string(9) "SIMPLE SY" ["product_price"]=> string(9) "51.240000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(3) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-27 12:29:09" ["product_name"]=> string(78) "CAP - Colore Rivestimento : S King KING-L ignifuco colore VERDE MILITARE - LVM" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-27 12:33:15" ["delivery_date"]=> string(19) "2018-02-27 12:33:16" ["id_order"]=> string(3) "246" ["reference"]=> string(9) "EZDOUNQFE" ["delivery_number"]=> string(2) "49" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "290.360000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(4) } array(14) { ["id_customer"]=> string(1) "2" ["date_add"]=> string(19) "2018-02-27 12:29:09" ["product_name"]=> string(70) "CAP - Colore Rivestimento : I Bondai no flame colore VERDE SCURO - SVS" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-27 12:33:15" ["delivery_date"]=> string(19) "2018-02-27 12:33:16" ["id_order"]=> string(3) "246" ["reference"]=> string(9) "EZDOUNQFE" ["delivery_number"]=> string(2) "49" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "286.090000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(5) }
The expected result must be:
array(14) { ["id_customer"]=> string(1) "8989" ["date_add"]=> string(19) "2018-02-27 12:29:09" ["product_name"]=> string(58) "SISY - Colore Rivestimento : I No Flame colore ROSSO -- IR" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-27 12:33:15" ["delivery_date"]=> string(19) "2018-02-27 12:33:16" ["id_order"]=> string(3) "246" ["reference"]=> string(9) "EZDOUNQFE" ["delivery_number"]=> string(2) "49" ["product_id"]=> string(3) "690" ["product_reference"]=> string(9) "SIMPLE SY" ["product_price"]=> string(9) "55.510000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(1) } array(14) { ["id_customer"]=> string(1) "8989" ["date_add"]=> string(19) "2018-02-27 12:29:09" ["product_name"]=> string(67) "SISY - Colore Rivestimento : I Bondai no flame colore CELESTE - SCB" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-27 12:33:15" ["delivery_date"]=> string(19) "2018-02-27 12:33:16" ["id_order"]=> string(3) "246" ["reference"]=> string(9) "EZDOUNQFE" ["delivery_number"]=> string(2) "49" ["product_id"]=> string(3) "690" ["product_reference"]=> string(9) "SIMPLE SY" ["product_price"]=> string(9) "55.510000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(2) } array(14) { ["id_customer"]=> string(1) "8989" ["date_add"]=> string(19) "2018-02-27 12:29:09" ["product_name"]=> string(51) "SISY - Colore Rivestimento : E Eco colore BLU -- EB" ["product_quantity"]=> string(1) "2" ["invoice_date"]=> string(19) "2018-02-27 12:33:15" ["delivery_date"]=> string(19) "2018-02-27 12:33:16" ["id_order"]=> string(3) "246" ["reference"]=> string(9) "EZDOUNQFE" ["delivery_number"]=> string(2) "49" ["product_id"]=> string(3) "690" ["product_reference"]=> string(9) "SIMPLE SY" ["product_price"]=> string(9) "51.240000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(3) } array(14) { ["id_customer"]=> string(1) "8989" ["date_add"]=> string(19) "2018-02-27 12:29:09" ["product_name"]=> string(78) "CAP - Colore Rivestimento : S King KING-L ignifuco colore VERDE MILITARE - LVM" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-27 12:33:15" ["delivery_date"]=> string(19) "2018-02-27 12:33:16" ["id_order"]=> string(3) "246" ["reference"]=> string(9) "EZDOUNQFE" ["delivery_number"]=> string(2) "49" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "290.360000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(4) } array(14) { ["id_customer"]=> string(1) "8989" ["date_add"]=> string(19) "2018-02-27 12:29:09" ["product_name"]=> string(70) "CAP - Colore Rivestimento : I Bondai no flame colore VERDE SCURO - SVS" ["product_quantity"]=> string(1) "1" ["invoice_date"]=> string(19) "2018-02-27 12:33:15" ["delivery_date"]=> string(19) "2018-02-27 12:33:16" ["id_order"]=> string(3) "246" ["reference"]=> string(9) "EZDOUNQFE" ["delivery_number"]=> string(2) "49" ["product_id"]=> string(3) "222" ["product_reference"]=> string(8) "CASTOR P" ["product_price"]=> string(10) "286.090000" ["payment"]=> string(22) "Cash on delivery (COD)" ["orderLine"]=> int(5) }
Edited the code like this in pastebin --> pastebin here but gives me error,
[PrestaShop] Fatal error in module file :/var/www/unisit_ecommerce/modules/advancedexport/advancedexport.php: Call to undefined method PDOStatement::fetch_array()
$sql = "SELECT codice_target FROM customer";
$result = $this->query($sql);
if(!$result)
{
return false;
}
while($row = $result->fetch_assoc())
{
$rows[] = $row;
}
foreach ($rows as $readyForExport['codice_target'])
{
return $readyForExport['codice_target'];
}
Meabe whe have to customize the MySqul query here ?
public function customersQuery($ae, $sorted_fields)
{
$sql = 'SELECT c.`id_customer` '.(empty($sorted_fields['sqlfields']) ? "" : ', '.implode(', ', $sorted_fields['sqlfields'])).'
FROM '._DB_PREFIX_.'customer c
LEFT JOIN `'._DB_PREFIX_.'address` a ON ( a.`id_customer` = c.`id_customer` )
WHERE 1'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).
(isset($sorted_fields['active']) && $sorted_fields['active'] ? ' AND c.`active` = 1' : '').
(isset($ae->only_new) && $ae->only_new ? ' AND c.`id_customer` > '.$ae->last_exported_id : '').
($ae->only_new == false && $ae->start_id ? ' AND c.`id_customer` >= '.$ae->start_id : '').
($ae->only_new == false && $ae->end_id ? ' AND c.`id_customer` <= '.$ae->end_id : '').
(isset($sorted_fields['active']) && $sorted_fields['active'] ? ' AND c.`active` = 1' : '').
(isset($ae->date_from) && $ae->date_from && !$ae->only_new ? ' AND c.`date_add` >= "'.($ae->date_from).'"' : '').
(isset($ae->date_to) && $ae->date_to && !$ae->only_new ? ' AND c.`date_add` <= "'.($ae->date_to).'"' : '');
$result = $this->query($sql);
$this->rowsNumber = $this->query("SELECT FOUND_ROWS()")->fetchColumn();
return $result;
}
thanks for all done since now!