|
|
@@ -636,6 +636,24 @@ class WechatService
|
|
|
$order_id
|
|
|
);
|
|
|
@file_put_contents("quanju.txt", json_encode($result) . "-查询签约状态返回结果\r\n", 8);
|
|
|
+ if ($result['return_code'] == 'SUCCESS' && $result['trade_state_desc'] == '支付成功'){
|
|
|
+ LaveMonth::where(['order_id' => $order_id])->update(['status' => 1]); //修改订单状态
|
|
|
+ }
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 查询签约关系
|
|
|
+ */
|
|
|
+ public static function querycontract($mch_id,$contract_id,$version='1.0',$options=[],$cid=0)
|
|
|
+ {
|
|
|
+ $appid='wx5681205d1ef4d9d3';
|
|
|
+ $order = array_merge(compact('appid','mch_id','contract_id','version'), $options);
|
|
|
+// if ($order['detail'] == '') unset($order['detail']);
|
|
|
+// $order['notify_url']=Request::instance()->domain() . "/api/wechat/notify/" . $cid;
|
|
|
+ $result = self::payment(false, $cid)->contract->querycontract(
|
|
|
+ $order
|
|
|
+ );
|
|
|
+// @file_put_contents("quanju.txt", json_encode($result) . "-查询签约状态返回结果\r\n", 8);
|
|
|
return $result;
|
|
|
}
|
|
|
}
|