Jump to content

Поиск в заказах по номеру телефона и e-mail


Recommended Posts

В api/Orders.php

заменить

		if(!empty($filter['keyword']))
		{
			$keywords = explode(' ', $filter['keyword']);
			foreach($keywords as $keyword)
				$keyword_filter .= $this->db->placehold('AND (o.id = "'.$this->db->escape(trim($keyword)).'" OR o.name LIKE "%'.$this->db->escape(trim($keyword)).'%" OR REPLACE(o.phone, "-", "")  LIKE "%'.$this->db->escape(str_replace('-', '', trim($keyword))).'%" OR o.address LIKE "%'.$this->db->escape(trim($keyword)).'%" )');
		}

на 

        if(!empty($filter['keyword'])) {
            $keywords = explode(' ', $filter['keyword']);
            foreach($keywords as $keyword) {
                $keyword_filter .= $this->db->placehold('AND (
                    o.id = "'.$this->db->escape(trim($keyword)).'" 
                    OR o.name LIKE "%'.$this->db->escape(trim($keyword)).'%" 
                    OR REPLACE(o.phone, "-", "")  LIKE "%'.$this->db->escape(str_replace('-', '', trim($keyword))).'%" 
                    OR o.address LIKE "%'.$this->db->escape(trim($keyword)).'%" 
                    OR o.email LIKE "%'.$this->db->escape(trim($keyword)).'%"
                ) ');
            }
        }

в simpla/OrdersAdmin.php 

заменить 

$keyword = $this->request->get('keyword', 'string');

на

$keyword = $this->request->get('keyword');

 

Поиск по id, по имени, о телефону, по адресу, по email

Edited by alexivchenko
Link to post
Share on other sites
22 часа назад, alexivchenko сказал:

В api/Orders.php

заменить


		if(!empty($filter['keyword']))
		{
			$keywords = explode(' ', $filter['keyword']);
			foreach($keywords as $keyword)
				$keyword_filter .= $this->db->placehold('AND (o.id = "'.$this->db->escape(trim($keyword)).'" OR o.name LIKE "%'.$this->db->escape(trim($keyword)).'%" OR REPLACE(o.phone, "-", "")  LIKE "%'.$this->db->escape(str_replace('-', '', trim($keyword))).'%" OR o.address LIKE "%'.$this->db->escape(trim($keyword)).'%" )');
		}

на 


        if(!empty($filter['keyword'])) {
            $keywords = explode(' ', $filter['keyword']);
            foreach($keywords as $keyword) {
                $keyword_filter .= $this->db->placehold('AND (
                    o.id = "'.$this->db->escape(trim($keyword)).'" 
                    OR o.name LIKE "%'.$this->db->escape(trim($keyword)).'%" 
                    OR REPLACE(o.phone, "-", "")  LIKE "%'.$this->db->escape(str_replace('-', '', trim($keyword))).'%" 
                    OR o.address LIKE "%'.$this->db->escape(trim($keyword)).'%" 
                    OR o.email LIKE "%'.$this->db->escape(trim($keyword)).'%"
                ) ');
            }
        }

в simpla/OrdersAdmin.php 

заменить 


$keyword = $this->request->get('keyword', 'string');

на


$keyword = $this->request->get('keyword');

 

Поиск по id, по имени, о телефону, по адресу, по email

Большое спасибо !!!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...