Commit cfb1140b authored by hujun's avatar hujun

查询拨打次数

parent 73c01599
...@@ -44,14 +44,32 @@ class AliYunSecretReport extends BaseModel ...@@ -44,14 +44,32 @@ class AliYunSecretReport extends BaseModel
/** /**
* 获取被拨打人的次数 * 获取被拨打人的次数
* *
* @param $phone_a
* @param $phone_b * @param $phone_b
* @param $start_date
* @param $end_date
* @return int|string * @return int|string
*/ */
public function getCallNumber($phone_b) { public function getCallNumber($phone_a, $phone_b, $start_date, $end_date) {
$date = date('Y-m-d');
return $this->where('time','>',0) if ($phone_a) {
->where('create_time', 'between time', [$date. ' 00:00:00', $date . ' 23:59:59']) $where['phone_no'] = $phone_a;
->where('peer_no', $phone_b) }
if ($phone_b) {
$where['peer_no'] = $phone_b;
}
if (!empty($start_date) && !empty($end_date)) {
$where['create_time'] = ['between time', $start_date. ' 00:00:00', $start_date . ' 23:59:59'];
} else {
$date = date('Y-m-d');
$where['create_time'] = ['between time', [$date. ' 00:00:00', $date . ' 23:59:59']];
}
$where['time'] = ['>', 0];
return $this->where($where)
->count(); ->count();
} }
} }
\ No newline at end of file
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