Commit ac6563e1 authored by hujun's avatar hujun

通话列表分页

parent 4adc66fd
......@@ -195,7 +195,8 @@ class CellPhone extends Basic
$where['user_nick'] = ['LIKE', $this->params['client_name'].'%'];
}
$data = $report->getCallList($pageNo, $pageSize, 'id desc', $field, $where);
$data['list'] = $report->getCallList($pageNo, $pageSize, 'id desc', $field, $where);
$data['total'] = $report->getCallListTotal($where);
return $this->response($result['code'], $result['msg'], $data);
}
......@@ -233,7 +234,8 @@ class CellPhone extends Basic
$where['phone'] = [$this->params['phone']];
}
$data = $report->getCallCollect($pageNo, $pageSize, 'id desc', $field, $where);
$data['list'] = $report->getCallCollect($pageNo, $pageSize, 'id desc', $field, $where);
$data['total'] = $report->getCallCollectTotal($where);
return $this->response($result['code'], $result['msg'], $data);
}
}
\ No newline at end of file
......@@ -92,6 +92,25 @@ class SecretReport extends Model
return $result;
}
/**
* 通话记录总记录数
*
* @param $params
* @return int|string
*/
public function getCallListTotal($params) {
if ($params['realName'] || $params['user_nick']) {
$data = $this->alias('a')->join('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;
}
/**
* 经纪人拨打记录汇总
*
......@@ -150,4 +169,18 @@ class SecretReport extends Model
return $result;
}
/**
* 经纪人拨打记录汇总总记录数
*
* @param $params
* @return int|string
*/
public function getCallCollectTotal($params) {
return $this->alias('a')
->join('agents b','a.agents_id=b.id','left')
->where($params)
->group('agents_id')
->count();
}
}
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