|
@@ -150,7 +150,7 @@ class WechatPay extends Api{
|
|
|
//查询团信息
|
|
|
$regimentInfo = Regiment::query()->where('id','=',$orderInfo['regiment_id'])->first()->toArray();
|
|
|
if (!$regimentInfo) {
|
|
|
- Log::log('notify_wechat_pay', '更新团订单失败' . json_encode($regimentInfo));
|
|
|
+ Log::log('notify_wechat_pay', '查询团信息失败' . json_encode($regimentInfo));
|
|
|
// 回退数据
|
|
|
DB::rollBack();
|
|
|
return json_send(['code'=>'FAIL']);
|
|
@@ -158,7 +158,7 @@ class WechatPay extends Api{
|
|
|
//查询团活动
|
|
|
$regimentActiveInfo = RegimentActive::query()->where('id','=',$regimentInfo['active_id'])->first();
|
|
|
if (!$regimentActiveInfo) {
|
|
|
- Log::log('notify_wechat_pay', '更新团订单失败' . json_encode($regimentInfo));
|
|
|
+ Log::log('notify_wechat_pay', '查询团活动失败' . json_encode($regimentInfo));
|
|
|
// 回退数据
|
|
|
DB::rollBack();
|
|
|
return json_send(['code'=>'FAIL']);
|
|
@@ -166,7 +166,7 @@ class WechatPay extends Api{
|
|
|
//查询团记录
|
|
|
$regimentRecordInfo = RegimentRecord::query()->where('order_id','=',$orderInfo['id'])->first();
|
|
|
if (!$regimentRecordInfo) {
|
|
|
- Log::log('notify_wechat_pay', '更新团订单失败' . json_encode($regimentInfo));
|
|
|
+ Log::log('notify_wechat_pay', '查询团记录失败' . json_encode($regimentInfo));
|
|
|
// 回退数据
|
|
|
DB::rollBack();
|
|
|
return json_send(['code'=>'FAIL']);
|
|
@@ -176,7 +176,7 @@ class WechatPay extends Api{
|
|
|
$inc = Regiment::query()->where('id','=',$regimentId)->increment('people_number',1);
|
|
|
Log::log('notify_wechat_pay', '拼团人数加1,regiment_id:'.$regimentId.';'. json_encode($inc));
|
|
|
if( !$inc ) {
|
|
|
- Log::log('notify_wechat_pay', '更新团订单失败' . json_encode($regimentInfo));
|
|
|
+ Log::log('notify_wechat_pay', '更新团人数加1失败' . json_encode($regimentInfo));
|
|
|
// 回退数据
|
|
|
DB::rollBack();
|
|
|
return json_send(['code'=>'FAIL']);
|
|
@@ -186,7 +186,7 @@ class WechatPay extends Api{
|
|
|
$res = regiment::query()->where('id','=',$regimentId)->update(['status'=>3]);
|
|
|
Log::log('notify_wechat_pay', '图满 团状态,regiment_id:'.$regimentId.';'. json_encode($res));
|
|
|
if( !$res ) {
|
|
|
- Log::log('notify_wechat_pay', '更新团订单失败' . json_encode($regimentInfo));
|
|
|
+ Log::log('notify_wechat_pay', '更新团订单失败1' . json_encode($regimentInfo));
|
|
|
// 回退数据
|
|
|
DB::rollBack();
|
|
|
return json_send(['code'=>'FAIL']);
|
|
@@ -194,7 +194,7 @@ class WechatPay extends Api{
|
|
|
//修改团记录状态
|
|
|
$res = RegimentRecord::query()->where('order_id','=',$orderInfo['id'])->update(['status'=>3]);
|
|
|
if( !$res ) {
|
|
|
- Log::log('notify_wechat_pay', '更新团订单失败' . json_encode($regimentInfo));
|
|
|
+ Log::log('notify_wechat_pay', '更新团记录状态失败' . json_encode($regimentInfo));
|
|
|
// 回退数据
|
|
|
DB::rollBack();
|
|
|
return json_send(['code'=>'FAIL']);
|
|
@@ -202,7 +202,7 @@ class WechatPay extends Api{
|
|
|
//修改订单
|
|
|
$orderRes = Orders::query()->where('regiment_id','=',$regimentId)->update(['status'=>'2']);
|
|
|
if( !$orderRes ) {
|
|
|
- Log::log('notify_wechat_pay', '更新团订单失败' . json_encode($regimentInfo));
|
|
|
+ Log::log('notify_wechat_pay', '更新订单失败' . json_encode($regimentInfo));
|
|
|
// 回退数据
|
|
|
DB::rollBack();
|
|
|
return json_send(['code'=>'FAIL']);
|
|
@@ -212,25 +212,6 @@ class WechatPay extends Api{
|
|
|
foreach ($orderList as $key => $value) {
|
|
|
if( $value['order_score'] > 0 ) $CustomScore->trade($orderInfo['custom_uid'],$value['id'],$value['order_score'],5,1);
|
|
|
}
|
|
|
- }else{
|
|
|
- //修改团状态
|
|
|
- if($regimentInfo['custom_uid'] == $orderInfo['custom_uid']){
|
|
|
- $res = Regiment::query()->where('id','=',$regimentId)->update(['status'=>0]);
|
|
|
- if( !$res ) {
|
|
|
- Log::log('notify_wechat_pay', '更新团订单失败' . json_encode($regimentInfo));
|
|
|
- // 回退数据
|
|
|
- DB::rollBack();
|
|
|
- return json_send(['code'=>'FAIL']);
|
|
|
- }
|
|
|
- }
|
|
|
- //修改团记录状态
|
|
|
- $res = RegimentRecord::query()->where('order_id','=',$orderInfo['id'])->update(['status'=>0]);
|
|
|
- if( !$res ) {
|
|
|
- Log::log('notify_wechat_pay', '更新团订单失败' . json_encode($regimentInfo));
|
|
|
- // 回退数据
|
|
|
- DB::rollBack();
|
|
|
- return json_send(['code'=>'FAIL']);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
// 提交数据
|