Commit 99936998 authored by zhuwei's avatar zhuwei

客户搜索条件限制

parent d4569c1e
...@@ -107,18 +107,31 @@ class User extends Basic ...@@ -107,18 +107,31 @@ class User extends Basic
} }
if (isset($params['user_name'])) { if (isset($params['user_name'])) {
if (strlen($params['user_name']) > 20) {
return $this->response(101, '输入内容长度超限');
}
$conditions['user_name'] = array( "like", "%" . trim($params['user_name']) . "%" ); $conditions['user_name'] = array( "like", "%" . trim($params['user_name']) . "%" );
$is_search = true; $is_search = true;
} }
if (isset($params['user_nick'])) { if (isset($params['user_nick'])) {
if (strlen($params['user_nick']) > 20) {
return $this->response(101, '输入内容长度超限');
}
$conditions['user_nick'] = array( "like", "%" . trim($params['user_nick']) . "%" ); $conditions['user_nick'] = array( "like", "%" . trim($params['user_nick']) . "%" );
$is_search = true; $is_search = true;
} }
if (isset($params['user_phone'])) { if (isset($params['user_phone'])) {
if (!is_numeric($params['user_phone'])) {
return $this->response(101, '请输入正确手机号');
}
if (strlen($params['user_phone']) > 20) {
return $this->response(101, '输入内容长度超限');
}
$conditions['user_phone'] = array( "like", "%" . trim($params['user_phone']) . "%" ); $conditions['user_phone'] = array( "like", "%" . trim($params['user_phone']) . "%" );
$is_search = true; $is_search = true;
} }
if (isset($params['yetai'])) { if (isset($params['yetai'])) {
$conditions['industry_type'] = array( "like", "%" . trim($params['yetai']) . "%" ); $conditions['industry_type'] = array( "like", "%" . trim($params['yetai']) . "%" );
} }
......
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