Commit 75b324f9 authored by hujun's avatar hujun

回调id判断

parent adbacda5
...@@ -42,14 +42,13 @@ class PrivacyNumber ...@@ -42,14 +42,13 @@ class PrivacyNumber
$call_time = strtotime($post_data[0]['release_time']) - strtotime($post_data[0]['start_time']); $call_time = strtotime($post_data[0]['release_time']) - strtotime($post_data[0]['start_time']);
$post_data[0]['time'] = $call_time; $post_data[0]['time'] = $call_time;
$report = new SecretReport();
$report->allowField(true)->save($post_data[0]);
if ($call_time > 0) { if ($call_time > 0) {
$date = date('Y-m-d'); $end_date = date('Y-m-d H:i:s', time());
$num = Db::table('aliyun_secret_report')->where('phone_no', $post_data[0]['phone_no']) $start_date = date('Y-m-d H:i:s', strtotime("-1 day"));
$num = Db::table('aliyun_secret_report')->where('phone_no', $post_data[0]['phone_no'])
->where('peer_no', $post_data[0]['peer_no']) ->where('peer_no', $post_data[0]['peer_no'])
->where('create_time','between', [$date .' 00:00:00', $date . ' 23:59:59']) ->where('create_time', 'between', [ $start_date, $end_date ])
->count('id'); ->count('id');
if (empty($num)) { if (empty($num)) {
...@@ -57,6 +56,9 @@ class PrivacyNumber ...@@ -57,6 +56,9 @@ class PrivacyNumber
$m_service->saveCallNumByUserId($post_data[0]['users_id']); $m_service->saveCallNumByUserId($post_data[0]['users_id']);
} }
} }
$report = new SecretReport();
$report->allowField(true)->save($post_data[0]);
Log::write(json_encode($post_data[0]), 'AliYunSecretReport'); //记录日志 Log::write(json_encode($post_data[0]), 'AliYunSecretReport'); //记录日志
return json_encode([ 'code' => 0, 'msg' => '接收成功' ]); return json_encode([ 'code' => 0, 'msg' => '接收成功' ]);
} }
...@@ -164,7 +166,7 @@ class PrivacyNumber ...@@ -164,7 +166,7 @@ class PrivacyNumber
$params = Request::instance()->param(); $params = Request::instance()->param();
/*搜索A经纪人agent_id and B客户 user_id */ /*搜索A经纪人agent_id and B客户 user_id */
$phone = explode('-', $params['userData']); $phone = explode('-', $params['userData']);
$phone_a = $phone[0]; $phone_a = $phone[0];
$phone_b = $phone[1]; $phone_b = $phone[1];
...@@ -175,7 +177,7 @@ class PrivacyNumber ...@@ -175,7 +177,7 @@ class PrivacyNumber
$call_type = 1; $call_type = 1;
} }
$date = [ $date = [
'call_id' => $params['callId'], 'call_id' => $params['callId'],
'phone_no' => $phone_a,/*A*/ 'phone_no' => $phone_a,/*A*/
'secret_no' => $params['servingNum'],/*X*/ 'secret_no' => $params['servingNum'],/*X*/
...@@ -254,10 +256,10 @@ class PrivacyNumber ...@@ -254,10 +256,10 @@ class PrivacyNumber
set_time_limit(0); set_time_limit(0);
$m_bind = new BindingPhone(); $m_bind = new BindingPhone();
$where['a.status'] = 1; $where['a.status'] = 1;
$where['a.type'] = 1; $where['a.type'] = 1;
$where['a.expiry_date'] = ['<', date('Y-m-d H:i:s')]; $where['a.expiry_date'] = [ '<', date('Y-m-d H:i:s') ];
$select_data = $m_bind->getBindingPhoneList('a.id,a.aliYun_phone_id,b.phone_x,a.subsId,a.expiry_date', $where); $select_data = $m_bind->getBindingPhoneList('a.id,a.aliYun_phone_id,b.phone_x,a.subsId,a.expiry_date', $where);
foreach ($select_data as $k => $v) { foreach ($select_data as $k => $v) {
$query_status = PlsDemo::querySubscriptionDetail($v['subsId'], $v['phone_x']); $query_status = PlsDemo::querySubscriptionDetail($v['subsId'], $v['phone_x']);
...@@ -272,7 +274,8 @@ class PrivacyNumber ...@@ -272,7 +274,8 @@ class PrivacyNumber
* 号码批量插入 * 号码批量插入
* @throws \Exception * @throws \Exception
*/ */
public function insertPhone() { public function insertPhone()
{
// $phone = [ // $phone = [
// //
// ]; // ];
......
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