Commit 1a3759d6 authored by hujun's avatar hujun

通话记录修改

parent cfde8125
......@@ -152,7 +152,7 @@ class CellPhone extends Basic
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$report = new SecretReport();
$field = 'agents_id,users_id,call_type,call_time,time,voice_file';
$field = 'agents_id,users_id,call_type,call_time,time,voice_file,user_status,a.id,a.create_time,type';
$where = [];
if (!empty($this->params['start_date'])) {
......@@ -164,7 +164,7 @@ class CellPhone extends Basic
}
if (!empty($this->params['call_name'])) {
$where['realName'] = ['LIKE', $this->params['call_name'] . '%'];
$where['name'] = ['LIKE', $this->params['call_name'] . '%'];
}
if (!empty($this->params['call_phone'])) {
......@@ -172,13 +172,16 @@ class CellPhone extends Basic
}
if (!empty($this->params['client_phone'])) {
$where['peer_no'] = ['LIKE', $this->params['client_phone'] . '%'];
$where['c.user_phone'] = ['LIKE', $this->params['client_phone'] . '%'];
}
if (!empty($this->params['client_name'])) {
$where['user_nick'] = ['LIKE', $this->params['client_name'] . '%'];
if (!empty($this->params['user_nick'])) {
$where['c.user_nick'] = ['LIKE', '%'.$this->params['user_nick'] . '%'];
}
if (!empty($this->params['call_type'])) {
$where['a.type'] = $this->params['call_type'];
}
$data['list'] = $report->getCallList($pageNo, $pageSize, 'id desc', $field, $where);
$data['total'] = $report->getCallListTotal($where);
return $this->response($result['code'], $result['msg'], $data);
......
......@@ -154,17 +154,17 @@ class Houses extends Basic
/*开始时间*/
if ($this->params['start_date'] != NULL && $this->params['end_date'] == NULL) {
$where['create_time'] = ['> time', $this->params['start_date'] . ' 00:00:00'];
$where['a.create_time'] = ['> time', $this->params['start_date'] . ' 00:00:00'];
}
/*结束时间*/
if ($this->params['end_date'] != NULL && $this->params['start_date'] == NULL) {
$where['create_time'] = ['< time', $this->params['end_date'] . ' 23:59:59'];
$where['a.create_time'] = ['< time', $this->params['end_date'] . ' 23:59:59'];
}
/*开始结束时间*/
if ($this->params['start_date'] != NULL && $this->params['end_date'] != NULL) {
$where['create_time'] = ['between time', [$this->params['start_date'] . ' 00:00:00', $this->params['end_date'] . ' 23:59:59']];
$where['a.create_time'] = ['between time', [$this->params['start_date'] . ' 00:00:00', $this->params['end_date'] . ' 23:59:59']];
}
/*根据库存判断是否已租*/
......@@ -190,7 +190,7 @@ class Houses extends Basic
}
$where['status'] = ['<>', 3];
$data['data']['list'] = $this->house->getHouseList($pageNo, $pageSize, 'id DESC', $fields, $where, $this->userId);
$data['data']['total'] = $this->house->getTotal($where);
$data['data']['total'] = $this->house->getHouseListTotal($where);
} else {
//盘方人搜索
/*楼盘编号*/
......
......@@ -89,6 +89,8 @@ class Basic extends Controller
$session_auth = Session::get("user_info.auth");
$auth_id = 0;
//去除管理验证
if ($this->userId != 1) {
//判断当前控制器用户是否拥有进入权限
foreach ($session_menu as $v){
//不区分大小写
......@@ -135,6 +137,7 @@ class Basic extends Controller
$this->error('没有当前页面权限');exit;
}
}
}
return true;
}
......
......@@ -16,7 +16,12 @@
<tr>
<td colspan="9">
<form id="form_search">
<span class="fore-span ld-Marheight">拨打类型:</span>
<select class="form-control btn2 ld-Marheight" id="call_type">
<option value="0">未分配</option>
<option value="1">阿里云</option>
<option value="2">容联云</option>
</select>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="industry_type" placeholder="拨打人姓名" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish" placeholder="拨打人手机号" type="phone" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="id" placeholder="被拨打人姓名" type="text" value="">
......@@ -40,30 +45,11 @@
<th class="text-center">花费</th>
<th class="text-center">跟进</th>
<th class="text-center">操作</th>
<th class="text-center">拨打类型</th>
</tr>
</thead>
<tbody class="text-center" id="callPhone_list">
<!--<tr>-->
<!--<td>212</td>-->
<!--<td>商场</td>-->
<!--<td>长兴</td>-->
<!--<td>1000</td>-->
<!--<td>是</td>-->
<!--<td>2018-01-16 17:02:00</td>-->
<!--<td>已租</td>-->
<!--<td>张娜张-->
<!--<a data-toggle="modal" data-id="77" href="#modal-watch" class="btn1 btn-danger add_applies">修改</a>-->
<!--</td>-->
<!--<td>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">编辑</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">推荐至首页</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">设置案场权限人</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">是否独家</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">操作记录</a>-->
<!--<a data-toggle="modal" data-id="77" href="#modal-watch" class="btn1 btn-danger add_applies" onclick="delete_house(4720)">删除</a>-->
<!--</td>-->
<!--</tr>-->
</tbody>
</table>
</div>
<!-- /#page-content-wrapper -->
......
......@@ -219,6 +219,20 @@ class GHouses extends BaseModel
return $result;
}
/**
* 楼盘列表
*
* @param string $params
* @return int|string
*/
public function getHouseListTotal($params = '')
{
return $this->alias('a')
->where($params)
->count();
}
/**
* 查询属于盘方的商铺列表
*
......
......@@ -26,37 +26,27 @@ class SecretReport extends Model
*/
public function getCallList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') {
if (!empty($params['realName']) || !empty($params['user_nick'])) {
$field .= ',a.id,a.create_time';
$data = $this->field($field)->alias('a')->join('agents b','a.agents_id=b.id','left')
$data = $this->field($field)->alias('a')
->join('a_agents b','a.agents_id=b.id','left')
->join('u_users c','a.users_id=c.id','left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
} else {
$field .= ',id,create_time';
$data = $this->field($field)
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
}
$result = [];
foreach ($data as $k => $v) {
$result[$k] = $v;
if ($v->agents_id) {
$agents_data = Db::table('agents')->field('realName,father_id')->where('id',$v->agents_id)->find();
$result[$k]['agents_name'] = $agents_data['realName'];
$shop_data = Db::table('agents')->field('agentshopname,sub_shopname')->where('id',$agents_data['father_id'])->find();
$result[$k]['shop_name'] = $shop_data['sub_shopname'] ? $shop_data['agentshopname'].'-'.$shop_data['sub_shopname'] : $shop_data['agentshopname'];
} else {
if (empty($v['agents_id'])) {
$result[$k]['agents_name'] = "";
} else {
$agents_data = Db::table('a_agents')->field('name,store_id')->where('id',$v['agents_id'])->find();
$store = new AStore();
$shop_name = $store->getStoreById($agents_data['store_id']);
$result[$k]['agents_name'] = $shop_name['district_name'].'-'. $agents_data['name'];
}
if ($v->users_id) {
......@@ -106,18 +96,13 @@ class SecretReport extends Model
* @return int|string
*/
public function getCallListTotal($params) {
if (!empty($params['realName']) || !empty($params['user_nick'])) {
$data = $this->alias('a')->join('agents b','a.agents_id=b.id','left')
return $this->alias('a')
->join('a_agents b','a.agents_id=b.id','left')
->join('u_users c','a.users_id=c.id','left')
->where($params)
->count();
} else {
$data = $this->where($params)
->count();
}
return $data;
}
/**
* 经纪人拨打记录汇总
*
......
......@@ -36,13 +36,13 @@ define (['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css','c
params.pageSize = callphone.pageSize;
params.call_name = $('#industry_type') .val();//拨打人姓名
params.call_phone = $('#dish') .val();//拨打人手机号
params.user_nick = $('id') .val();//被拨打人姓名
params.user_nick = $('#id') .val();//被拨打人姓名
params.client_phone = $('#dish-phone') .val();//拨打人手机号
params.start_date = $('#start_date') .val();//时间1
params.end_date = $('#end_date') .val();//时间2
params.call_type = $("#call_type").val();
$.ajax ({
url: '/index/callLog.html',//获取列表
url: '/index/callLog',//获取列表
type: 'GET',
async: true,
data: params,
......
......@@ -272,7 +272,9 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
},
dataType: 'json',
success: function (data) {
if (data.code != 200) {
if (data.code == 200) {
user.getList(1);
} else {
alert(data.msg);
}
}
......
......@@ -4,13 +4,38 @@
<tr class="text-center">
<td>[%= it[item]['call_time'] %]</td>
<td>[%= it[item]['agents_name'] %]</td>
<td>[%= it[item]['user_nick'] %]</td>
<td>
[% if(it[item]['user_nick'] != null) { %]
[%= it[item]['user_nick'] %]
[% } %]
</td>
<td>[%= it[item]['time'] %]</td>
<td>[%= it[item]['price'] %] </td>
<td>[%= it[item]['follow_up'] %]</td>
<td>
[% if(it[item]['follow_up'] != null) { %]
[%= it[item]['follow_up'] %]
[% } %]
[% if(it[item]['user_status'] == 0) { %]
【求租】
[% } else if(it[item]['user_status'] == 1) { %]
【已租】
[% }else{ %]
【无效】
[% } %]
</td>
<td>
<video id="media" src="[%= it[item]['voice_file'] %]" controls width="200px" height="38px" ></video>
</td>
<td>
[% if(it[item]['type'] == 0) { %]
未分配
[% } else if(it[item]['type'] == 1) { %]
阿里云
[% }else{ %]
容联云
[% } %]
</td>
</tr>
[% } %]
[% }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