作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

测试隐私通话

... ... @@ -182,19 +182,7 @@ class Dispute extends Backend
(new Wechat)->tmplmsg($openid,$send_data,$templateid,$url);
// 解绑隐私通话
$has_number = PrivateNumberModel::get(['order_id'=>$row['order_id']]);
if($has_number){
$count = PrivateNumberModel::alias('a')
->join('order b','a.order_id = b.id')
->where('a.subscription_id',$has_number['subscription_id'])
->where('b.status','in','2,3,5')
->count();
if($count > 1){
$has_number->delete();
}else{
(new PrivateNumber)->unbind($has_number['subscription_id']);
}
}
\app\common\controller\Order::unbindPrivateNumber($order['id']);
// 修改数据
$result = $row->allowField(true)->save($params);
... ...
... ... @@ -813,7 +813,7 @@ class Order extends Api
if($count > 1){
$has_number->delete();
}else{
(new PrivateNumber)->unbind($has_number['subscription_id']);
PrivateNumber::unbind($has_number['subscription_id']);
}
}
}
... ...
... ... @@ -203,7 +203,7 @@ class PrivateNumber extends Api
/**
* 解绑接口
*/
public function unbind($subscriptionId = '',$relationNum = '')
public static function unbind($subscriptionId = '',$relationNum = '')
{
// 必填,请参考"开发准备"获取如下数据,替换为实际值
$realUrl = config('privatenumber.real_url'); // APP接入地址+接口访问URI
... ... @@ -250,11 +250,11 @@ class PrivateNumber extends Api
// print_r($response . PHP_EOL); // 打印响应结果
$res = json_decode($response,true);
if($res['resultcode'] != '0') {
$this->error($res['resultdesc']);
self::error($res['resultdesc']);
}
Db::name('private_number')->where('subscription_id',$subscriptionId)->delete();
} catch (Exception $e) {
$this->error($e->getMessage());
self::error($e->getMessage());
}
}
... ...