...
|
...
|
@@ -442,15 +442,7 @@ class Order extends Api |
|
|
$url = config('tmplmsg.vue_url').'/wallet';
|
|
|
(new Wechat)->tmplmsg($openid,$send_data,$templateid,$url);
|
|
|
// 解绑隐私通话
|
|
|
$has_number = PrivateNumberModel::get(['order_id'=>$order['id']]);
|
|
|
if($has_number){
|
|
|
$count = PrivateNumberModel::where('subscription_id',$has_number['subscription_id'])->count();
|
|
|
if($count > 1){
|
|
|
$has_number->delete();
|
|
|
}else{
|
|
|
(new PrivateNumber)->unbind($has_number['subscription_id']);
|
|
|
}
|
|
|
}
|
|
|
self::unbindPrivateNumber($order['id']);
|
|
|
return true;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -640,15 +632,7 @@ class Order extends Api |
|
|
$url = config('tmplmsg.vue_url').'/indenta?id='.$grab['id'].'&type=4';
|
|
|
(new Wechat)->tmplmsg($openid,$send_data,$templateid,$url);
|
|
|
// 解绑隐私通话
|
|
|
$has_number = PrivateNumberModel::get(['order_id'=>$order['id']]);
|
|
|
if($has_number){
|
|
|
$count = PrivateNumberModel::where('subscription_id',$has_number['subscription_id'])->count();
|
|
|
if($count > 1){
|
|
|
$has_number->delete();
|
|
|
}else{
|
|
|
(new PrivateNumber)->unbind($has_number['subscription_id']);
|
|
|
}
|
|
|
}
|
|
|
self::unbindPrivateNumber($order['id']);
|
|
|
return true;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -807,4 +791,25 @@ class Order extends Api |
|
|
}
|
|
|
$this->success('成功');
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @ApiInternal
|
|
|
* 解绑隐私号码
|
|
|
*/
|
|
|
public static function unbindPrivateNumber($order_id){
|
|
|
// 解绑隐私通话
|
|
|
$has_number = PrivateNumberModel::get(['order_id'=>$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']);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|