Commit a91b1ed3 authored by hujun's avatar hujun

通话记录列表修改

parent f1117630
...@@ -39,7 +39,7 @@ class CellPhone extends Basic ...@@ -39,7 +39,7 @@ class CellPhone extends Basic
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$report = new SecretReport(); $report = new SecretReport();
$field = 'agents_id,users_id,call_type,call_time,time,voice_file,user_status,a.id,a.create_time,type'; $field = 'agents_id,users_id,call_type,call_time,time,voice_file,user_status,a.id,a.create_time,type,secret_no';
$where = []; $where = [];
if (!empty($this->params['start_date'])) { if (!empty($this->params['start_date'])) {
...@@ -54,25 +54,26 @@ class CellPhone extends Basic ...@@ -54,25 +54,26 @@ class CellPhone extends Basic
$where['a.call_time'] = [ 'between', [ $this->params['start_date'] . ' 00:00:00', $this->params['end_date'] . ' 23:59:59' ] ]; $where['a.call_time'] = [ 'between', [ $this->params['start_date'] . ' 00:00:00', $this->params['end_date'] . ' 23:59:59' ] ];
} }
if (!empty($this->params['call_name'])) { if (!empty($this->params['call_type'])) {
$where['name'] = [ 'LIKE', $this->params['call_name'] . '%' ]; $where['a.type'] = $this->params['call_type'];
} }
if (!empty($this->params['call_phone'])) { if (!empty($this->params['call_name'])) {
$where['phone_no'] = [ 'LIKE', $this->params['call_phone'] . '%' ]; $where[] = ['EXP', "b.name like '%{$this->params['call_name']}%' or b.name like '%{$this->params['peer_no']}%' "];
} }
if (!empty($this->params['client_phone'])) { if (!empty($this->params['call_phone'])) {
$where['c.user_phone'] = [ 'LIKE', $this->params['client_phone'] . '%' ]; $where[] = ['EXP', "a.phone_no like '%{$this->params['call_phone']}%' or a.peer_no like '%{$this->params['call_phone']}%' "];
} }
if (!empty($this->params['user_nick'])) { if (!empty($this->params['call_style'])) {
$where['c.user_nick'] = [ 'LIKE', '%' . $this->params['user_nick'] . '%' ]; if ($this->params['call_style'] == 1) {
$where['a.call_type'] = 0;
} else {
$where['a.call_type'] = 1;
}
} }
if (!empty($this->params['call_type'])) {
$where['a.type'] = $this->params['call_type'];
}
$data['list'] = $report->getCallList($pageNo, $pageSize, 'id desc', $field, $where); $data['list'] = $report->getCallList($pageNo, $pageSize, 'id desc', $field, $where);
$data['total'] = $report->getCallListTotal($where); $data['total'] = $report->getCallListTotal($where);
return $this->response($result['code'], $result['msg'], $data); return $this->response($result['code'], $result['msg'], $data);
......
...@@ -27,11 +27,14 @@ ...@@ -27,11 +27,14 @@
<option value="1">阿里云</option> <option value="1">阿里云</option>
<option value="2">容联云</option> <option value="2">容联云</option>
</select> </select>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="industry_type" placeholder="拨打人姓名" type="text" value=""> <span class="fore-span ld-Marheight">呼叫方式:</span>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish" placeholder="拨打人手机号" type="phone" value=""> <select class="form-control btn2 ld-Marheight" id="call_style">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="id" placeholder="被拨打人姓名" type="text" value=""> <option value="0">请选择</option>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish-phone" placeholder="拨打人手机号" type="phone" value=""> <option value="1">主叫</option>
<div class="clear"></div> <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="">
<span class="fore-span ld-Marheight">拨打时间:</span> <span class="fore-span ld-Marheight">拨打时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date" type="date">
<span class="fore-span ld-Marheight">-</span> <span class="fore-span ld-Marheight">-</span>
...@@ -44,12 +47,13 @@ ...@@ -44,12 +47,13 @@
</tr> </tr>
<tr> <tr>
<th class="text-center">拨打时间</th> <th class="text-center">拨打时间</th>
<th class="text-center">拨打人</th> <th class="text-center">拨打人(主叫)</th>
<th class="text-center">被拨打人</th> <th class="text-center">隐私号码</th>
<th class="text-center">被拨打人(被叫)</th>
<th class="text-center">通话时长</th> <th class="text-center">通话时长</th>
<th class="text-center">花费</th> <!--<th class="text-center">花费</th>-->
<th class="text-center">跟进</th> <th class="text-center">跟进</th>
<th class="text-center">操作</th> <th class="text-center">录音</th>
<th class="text-center">拨打类型</th> <th class="text-center">拨打类型</th>
</tr> </tr>
</thead> </thead>
......
...@@ -42,14 +42,18 @@ class SecretReport extends BaseModel ...@@ -42,14 +42,18 @@ class SecretReport extends BaseModel
if (empty($v['agents_id'])) { if (empty($v['agents_id'])) {
$result[$k]['agents_name'] = ""; $result[$k]['agents_name'] = "";
} else { } else {
$agents_data = Db::table('a_agents')->field('name,store_id')->where('id',$v['agents_id'])->find(); $agents_data = Db::table('a_agents')->field('name,store_id,phone')->where('id',$v['agents_id'])->find();
$store = new AStore(); // $store = new AStore();
$shop_name = $store->getStoreById($agents_data['store_id']); // $shop_name = $store->getStoreById($agents_data['store_id']);
$result[$k]['agents_name'] = $shop_name['district_name'].'-'. $agents_data['name']; // $result[$k]['agents_name'] = $shop_name['district_name'].'-'. $agents_data['name'].'-'.$agents_data['phone'];
$result[$k]['agents_name'] = $agents_data['name'].'-'.$agents_data['phone'];
} }
if ($v->users_id) { if ($v->users_id) {
$result[$k]['user_nick'] = Db::table('u_users')->where('id',$v->users_id)->value('user_nick'); $user_data = Db::table('u_users')->field('user_name,user_phone')->where('id',$v->users_id)->find();
$user_data['user_name'] = empty($user_data['user_name']) ? '?.?' : $user_data['user_name'];
// $result[$k]['user_nick'] = $user_data['user_name'] .'-'. hide_customer_phone($user_data['user_phone']);
$result[$k]['user_name'] = $user_data['user_name'] .'-'. $user_data['user_phone'];
$result[$k]['follow_up'] = Db::table('u_phone_follow_up')->where('user_id',$v->users_id)->order('id DESC')->value('content'); $result[$k]['follow_up'] = Db::table('u_phone_follow_up')->where('user_id',$v->users_id)->order('id DESC')->value('content');
} else { } else {
$result[$k]['user_nick'] = ""; $result[$k]['user_nick'] = "";
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
define (['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css','ckfinder','ckfinderStart','pagination','bootstrapJs'], function (doT, template) { define (['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css','ckfinder','ckfinderStart','pagination','bootstrapJs'], function (doT, template) {
callphone = { callphone = {
pageNo: 1, /*第几页*/ pageNo: 1, /*第几页*/
pageSize: 10, /*每页显示多少条*/ pageSize: 20, /*每页显示多少条*/
id : '', id : '',
house_id:'', house_id:'',
type:'', type:'',
...@@ -36,11 +36,10 @@ define (['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css','c ...@@ -36,11 +36,10 @@ define (['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css','c
params.pageSize = callphone.pageSize; params.pageSize = callphone.pageSize;
params.call_name = $('#industry_type') .val();//拨打人姓名 params.call_name = $('#industry_type') .val();//拨打人姓名
params.call_phone = $('#dish') .val();//拨打人手机号 params.call_phone = $('#dish') .val();//拨打人手机号
params.user_nick = $('#id') .val();//被拨打人姓名
params.client_phone = $('#dish-phone') .val();//拨打人手机号
params.start_date = $('#start_date') .val();//时间1 params.start_date = $('#start_date') .val();//时间1
params.end_date = $('#end_date') .val();//时间2 params.end_date = $('#end_date') .val();//时间2
params.call_type = $("#call_type").val(); params.call_type = $("#call_type").val();
params.call_style = $("#call_style").val();
$.ajax ({ $.ajax ({
url: '/index/callLog',//获取列表 url: '/index/callLog',//获取列表
type: 'GET', type: 'GET',
......
...@@ -8,14 +8,27 @@ ...@@ -8,14 +8,27 @@
[%= it[item]['call_time'] %] [%= it[item]['call_time'] %]
[% } %] [% } %]
</td> </td>
<td>[%= it[item]['agents_name'] %]</td>
<td> [% if(it[item]['call_type'] == 0) { %]
[% if(it[item]['user_nick'] != null) { %] <td>[%= it[item]['agents_name'] %]</td>
[%= it[item]['user_nick'] %] <td>[%= it[item]['secret_no'] %]</td>
[% } %] <td>
</td> [% if(it[item]['user_name'] != null) { %]
[%= it[item]['user_name'] %]
[% } %]
</td>
[% }else{ %]
<td>
[% if(it[item]['user_name'] != null) { %]
[%= it[item]['user_name'] %]
[% } %]
</td>
<td>[%= it[item]['secret_no'] %]</td>
<td>[%= it[item]['agents_name'] %]</td>
[% } %]
<td>[%= it[item]['time'] %]</td> <td>[%= it[item]['time'] %]</td>
<td>[%= it[item]['price'] %] </td> <!--<td>[%= it[item]['price'] %] </td>-->
<td> <td>
[% if(it[item]['follow_up'] != null) { %] [% if(it[item]['follow_up'] != null) { %]
[%= it[item]['follow_up'] %] [%= it[item]['follow_up'] %]
......
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