Commit cbc15734 authored by clone's avatar clone

1

parent c3de7bd5
......@@ -247,12 +247,30 @@ class LookShop extends Basic
if (isset($params["phone"])) {
$where_["phone"] = array("like", "%" . trim($params['phone']) . "%");
}
$where_["is_del"] = 0;
$ids = "";
if ($where_) {
$agentModel = new AAgents();
$agentArr = $agentModel->getAgentById("id", $where_);
if (count($agentArr) > 0) {
foreach ($agentArr as $item) {
$ids .= $item["id"] . ",";
}
$ids = rtrim($ids, ",");
} else {
return $this->response("200", "request null");
}
}
$params_["is_del"] = 0;
if ($ids) {
$params_["agent_id"] = array("in", $ids);
}
$aLookShopWhitelistModel = new ALookShopWhitelist();
$field = "id,agent_id,is_del";
$agentList = $aLookShopWhitelistModel->getWhitelistList($field, $where_, 1, 50);
$agentList = $aLookShopWhitelistModel->getWhitelistList($field, $params_, 1, 50);
if (count($agentList) <= 0) {
return $this->response("200", "request null");
......
......@@ -25,6 +25,13 @@
</div>
</div>
<div style="width:50%;margin: 10px">
<input class="form-control btn5" data-rule-phoneus="false" data-rule-required="false" id="name" placeholder="经纪人姓名" type="text">
<input class="form-control btn5" data-rule-phoneus="false" data-rule-required="false" id="phone" placeholder="手机号" type="text">
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="form_search_reset">重置</span>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
......
......@@ -36,6 +36,9 @@ define(['doT', 'text!temp/whitelist_template_tpl.html', 'css!style/home.css', 'b
params.submit_agent_id = user_info_obj.id;
whitelist.upLookShop(params);
});
$("#search").click(function () {
whitelist.getWhitelist();
});
$(document).delegate(".up_look_shop", "click", function () {
......@@ -120,6 +123,16 @@ define(['doT', 'text!temp/whitelist_template_tpl.html', 'css!style/home.css', 'b
/*获取 list*/
getWhitelist: function () {
var params = {};
var name = $("#name").val();
var phone = $("#phone").val();
if (name) {
params.name = name;
}
if (phone && phone.length > 3) {
params.phone = phone;
}else if(phone && phone.length <= 3){
alert("手机号必须输入四位或以上");
}
$.ajax({
url: '/admin.php/index/getWhitelist',
type: 'get',
......
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