Commit 2601d39e by Tobin

Merge branch 'master' into 'dev_production'

customer re-register issue See merge request !317
parents 049227f9 b6bee6a6
......@@ -47,7 +47,7 @@ class Api_model extends CI_Model {
$phone_code = preg_replace('/\D/', '', $data['phone_code']);
$sql = "SELECT * FROM customer
INNER JOIN `users` ON users.id=customer.customer_id AND users.user_type='3'
INNER JOIN `users` ON users.id=customer.customer_id
WHERE users.status!='2' AND (customer.email = '$email' OR
(customer.phone_code='$phone_code' AND customer.phone LIKE '%$phone'))";
$res_count = $this->db->query($sql)->row();
......
......@@ -110,8 +110,10 @@ class Webservice_model extends CI_Model {
$is_phone_available = "true";
$data['phone'] = preg_replace('/\D/', '', $data['phone']);
$sql = "SELECT * FROM customer
WHERE phone like '%".$data['phone']."' OR email='".$data['email']."'";
$sql = "SELECT * FROM customer AS CUST
INNER JOIN users AS USR ON (USR.id=CUST.customer_id)
WHERE (phone like '%".$data['phone']."' OR email='".$data['email']."') AND
USR.status != '2'";
$res_count = $this->db->query($sql)->result();
if(count($res_count) > 0) {
foreach ($res_count as $rs) {
......@@ -139,7 +141,7 @@ class Webservice_model extends CI_Model {
$email = $data['email'];
$phone = preg_replace('/\D/', '', $data['phone']);
$res_count = $this->db->query("SELECT * FROM customer
INNER JOIN `users` ON users.id=customer.customer_id AND users.user_type='3'
INNER JOIN `users` ON users.id=customer.customer_id
WHERE users.status!='2' AND
(customer.email = '$email' OR customer.phone LIKE '%$phone')")->row();
if(count($res_count) > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment