Commit c3853067 authored by clone's avatar clone

bug

parent ad0cde0f
...@@ -67,15 +67,17 @@ class HomePageLog extends Basic ...@@ -67,15 +67,17 @@ class HomePageLog extends Basic
} }
if (!empty($params["name_or_phone"])) { if (!empty($params["name_or_phone"])) {
if ((preg_match("/^1\d{10}$/", $params['name_or_phone']) != 1) and (strlen($params['name_or_phone']) < 6)) { if ((preg_match("/^1\d{10}$/", $params['name_or_phone']) == 1)) {
$agent_params["phone"] = array( "eq", trim($params["name_or_phone"]) );
} elseif (strlen($params['name_or_phone']) >= 6) {
$agent_params["name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
} else {
return $this->response("101", '手机号有误或者姓名不满两位汉字'); return $this->response("101", '手机号有误或者姓名不满两位汉字');
} }
// $agent_params["phone|name"] = $params["name_or_phone"];
$agent_params["phone|name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
$agent_field = "id"; $agent_field = "id";
$model = new AAgents(); $model = new AAgents();
$res_a = $model->getAgentsIdsArray($agent_field, $agent_params); $res_a = $model->getAgentsIdsArray($agent_field, $agent_params);
if ($res_a) { if ($res_a) {
$where_["f.agent_id"] = [ 'in', $res_a ]; $where_["f.agent_id"] = [ 'in', $res_a ];
} else { } else {
...@@ -172,14 +174,16 @@ class HomePageLog extends Basic ...@@ -172,14 +174,16 @@ class HomePageLog extends Basic
if (!empty($params["name_or_phone"])) { if (!empty($params["name_or_phone"])) {
if ((preg_match("/^1\d{10}$/", $params['name_or_phone']) != 1) and (strlen($params['name_or_phone']) < 6)) { if ((preg_match("/^1\d{10}$/", $params['name_or_phone']) == 1)) {
$agent_params["phone"] = array( "eq", trim($params["name_or_phone"]) );
} elseif (strlen($params['name_or_phone']) >= 6) {
$agent_params["name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
} else {
return $this->response("101", '手机号有误或者姓名不满两位汉字'); return $this->response("101", '手机号有误或者姓名不满两位汉字');
} }
$agent_params["phone|name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" ); $agent_field = "id";
// $agent_params["phone|name"] = $params["name_or_phone"]; $model = new AAgents();
$agent_field = "id"; $res_a = $model->getAgentsIdsArray($agent_field, $agent_params);
$model = new AAgents();
$res_a = $model->getAgentsIdsArray($agent_field, $agent_params);
if ($res_a) { if ($res_a) {
$where_["f.agent_id"] = [ 'in', $res_a ]; $where_["f.agent_id"] = [ 'in', $res_a ];
} else { } else {
......
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