本文整理汇总了PHP中Customer::searchByName方法的典型用法代码示例。如果您正苦于以下问题:PHP Customer::searchByName方法的具体用法?PHP Customer::searchByName怎么用?PHP Customer::searchByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customer
的用法示例。
在下文中一共展示了Customer::searchByName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajax_agile_getcustomers
function ajax_agile_getcustomers()
{
${${"GLOBALS"}["jjszcyoinwyy"]} = explode(" ", Tools::getValue("customer_search"));
${"GLOBALS"}["btkmsumgqi"] = "customers";
$lwjbynsy = "searches";
$mfzpveyc = "to_return";
$bmwjhsn = "customers";
${"GLOBALS"}["mcqemkddxvk"] = "searches";
$cccuivsxp = "to_return";
${${"GLOBALS"}["kglmxvwgfexa"]} = array();
${${"GLOBALS"}["mcqemkddxvk"]} = array_unique(${$lwjbynsy});
foreach (${${"GLOBALS"}["jjszcyoinwyy"]} as ${${"GLOBALS"}["dotono"]}) {
$mimdxaoxdl = "results";
if (!empty(${${"GLOBALS"}["dotono"]}) && (${$mimdxaoxdl} = Customer::searchByName(${${"GLOBALS"}["dotono"]}))) {
foreach (${${"GLOBALS"}["itmfakpwu"]} as ${${"GLOBALS"}["dbgjiec"]}) {
${"GLOBALS"}["cgwtffyvk"] = "result";
${${"GLOBALS"}["kglmxvwgfexa"]}[${${"GLOBALS"}["dbgjiec"]}["id_customer"]] = ${${"GLOBALS"}["cgwtffyvk"]};
}
}
}
if (count(${${"GLOBALS"}["btkmsumgqi"]})) {
${$cccuivsxp} = array("customers" => ${$bmwjhsn}, "found" => true);
} else {
${$mfzpveyc} = array("found" => false);
}
return Tools::jsonEncode(${${"GLOBALS"}["nduihox"]});
}
示例2: ajaxProcess
/**
* Method called when an ajax request is made
* @see AdminController::postProcess()
*/
public function ajaxProcess()
{
if (Tools::isSubmit('email')) {
$email = pSQL(Tools::getValue('email'));
$customer = Customer::searchByName($email);
if (!empty($customer)) {
$customer = $customer['0'];
echo Tools::jsonEncode(array('infos' => pSQL($customer['firstname']) . '_' . pSQL($customer['lastname']) . '_' . pSQL($customer['company'])));
}
}
die;
}
示例3: searchCustomer
/**
* Search a specific name in the customers
*
* @params string $query String to find in the catalog
*/
public function searchCustomer()
{
$this->_list['customers'] = Customer::searchByName($this->query);
}
示例4: ajaxProcessSearchCustomers
/**
* add to $this->content the result of Customer::SearchByName
* (encoded in json)
*
* @return void
*/
public function ajaxProcessSearchCustomers()
{
$searches = explode(' ', Tools::getValue('customer_search'));
$customers = array();
$searches = array_unique($searches);
foreach ($searches as $search) {
if (!empty($search) && ($results = Customer::searchByName($search, 50))) {
foreach ($results as $result) {
if ($result['active']) {
$customers[$result['id_customer']] = $result;
}
}
}
}
if (count($customers)) {
$to_return = array('customers' => $customers, 'found' => true);
} else {
$to_return = array('found' => false);
}
$this->content = Tools::jsonEncode($to_return);
}
示例5: ajaxProcessSearchCustomers
public function ajaxProcessSearchCustomers()
{
if ($customers = Customer::searchByName(pSQL(Tools::getValue('customer_search')))) {
$to_return = array('customers' => $customers, 'found' => true);
} else {
$to_return = array('found' => false);
}
$this->content = Tools::jsonEncode($to_return);
}
示例6: ajaxProcessSearchCustomers
/**
* add to $this->content the result of Customer::SearchByName
* (encoded in json)
*
* @return void
*/
public function ajaxProcessSearchCustomers()
{
$searches = explode(' ', Tools::getValue('customer_search'));
$customers = array();
$searches = array_unique($searches);
foreach ($searches as $search) {
if (!empty($search) && ($results = Customer::searchByName($search, 50))) {
foreach ($results as $result) {
if ($result['active']) {
$result['fullname_and_email'] = $result['firstname'] . ' ' . $result['lastname'] . ' - ' . $result['email'];
$customers[$result['id_customer']] = $result;
}
}
}
}
if (count($customers) && Tools::getValue('sf2')) {
$to_return = $customers;
} elseif (count($customers) && !Tools::getValue('sf2')) {
$to_return = array('customers' => $customers, 'found' => true);
} else {
$to_return = Tools::getValue('sf2') ? array() : array('found' => false);
}
$this->content = json_encode($to_return);
}
示例7: searchCustomer
/**
* Search a specific name in the customers
*
* @params string $query String to find in the catalog
*/
public function searchCustomer($query)
{
$this->_list['customers'] = Customer::searchByName(trim($query));
}