|
@@ -274,7 +274,7 @@ class Payios extends Api
|
|
|
if($only_trans['purchase_date_ms'] <= $order_info['purchase_date_ms'] || $only_trans['expires_date_ms'] <= $order_info['expires_date_ms']){
|
|
|
Db::rollback();
|
|
|
filePut($prefix.'时间对不上,返回成功,finish掉');
|
|
|
- $this->success(1);
|
|
|
+ $this->success('时间对不上,返回成功,finish掉');
|
|
|
}
|
|
|
// }
|
|
|
|
|
@@ -403,9 +403,27 @@ class Payios extends Api
|
|
|
foreach($in_app as $key => $trans){
|
|
|
//非订阅信息,原始信息
|
|
|
// $trans['transaction_id'] == $transaction_id 这个不重要,重要的是后面2个。应该也重要,保证这次处理的是初始交易
|
|
|
- if($trans['transaction_id'] == $transaction_id && $transaction_id == $trans['original_transaction_id'] && $trans['product_id'] == $order_info['bundle_id']){
|
|
|
- $only_trans = $trans;
|
|
|
- break;
|
|
|
+ if($trans['transaction_id'] == $transaction_id && $transaction_id == $trans['original_transaction_id']){
|
|
|
+ if($trans['product_id'] == $order_info['bundle_id']){
|
|
|
+ $only_trans = $trans;
|
|
|
+ break;
|
|
|
+ }else{
|
|
|
+ //找上一个真正的订单
|
|
|
+ $order_map = [
|
|
|
+ 'user_id' => $this->auth->id,
|
|
|
+ 'order_status' => 0,
|
|
|
+ 'bundle_id' => $trans['product_id']
|
|
|
+ ];
|
|
|
+ $order_info = Db::name('pay_order')->where($order_map)->lock(true)->find();
|
|
|
+ if (!$order_info) {
|
|
|
+ Db::rollback();
|
|
|
+ filePut($prefix.'不存在的正确产品订单');
|
|
|
+ $this->error('不存在的正确产品订单');
|
|
|
+ }
|
|
|
+
|
|
|
+ $only_trans = $trans;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if(empty($only_trans)){
|