Selaa lähdekoodia

去掉会员升级

gorden 1 kuukausi sitten
vanhempi
säilyke
1507749d62

+ 22 - 21
app/admin/controller/notify/RechargeController.php

@@ -55,20 +55,20 @@ class RechargeController
         if (is_json($data)) {
             $data = json_decode($data, true);
         }
-        _syslog("APP充值","APP充值回调开始",$data,$data,1001);
+        _syslog("APP充值", "APP充值回调开始", $data, $data, 1001);
         if (!$data['pay_id']) {
             return json_fail('参数异常');
         }
         try {
             $result = $this->disposePaySuccess($data['pay_id']);
-            _syslog("APP充值","APP处理完成",$data,$data,1001);
+            _syslog("APP充值", "APP处理完成", $data, $data, 1001);
 
             return $result;
-        }catch(BusinessException $e){
-            _syslog("APP充值","APP充值失败",$data,$data,1001);
+        } catch (BusinessException $e) {
+            _syslog("APP充值", "APP充值失败", $data, $data, 1001);
             return json_fail("处理失败");
-        }catch (\Exception $e){
-            _syslog("APP充值","APP充值失败",$data,$data,1001);
+        } catch (\Exception $e) {
+            _syslog("APP充值", "APP充值失败", $data, $data, 1001);
             return json_fail("处理失败");
         }
 
@@ -89,10 +89,11 @@ class RechargeController
      * @return \support\Response
      * @throws BusinessException
      */
-    public function disposePaySuccess($payId){
+    public function disposePaySuccess($payId)
+    {
         $payDetail = PayDetail::find($payId);
         if (!$payDetail || $payDetail->pay_status != 'SUCCESS') {
-             throw new BusinessException("支付状态异常");
+            throw new BusinessException("支付状态异常");
 //           return json_fail("支付状态异常");
         }
         $extendJson = [];
@@ -113,9 +114,9 @@ class RechargeController
             $addedNbr = 0;
             if (isset($objectJson['order_id'])) {
                 // 对应订单设置已完成
-                Order::where('order_groupby',$payDetail->join_pay_order_id)->update(['order_status_system'=>'DONE','order_is_complete'=>'Y','order_status_storage'=>'DONE']);
+                Order::where('order_groupby', $payDetail->join_pay_order_id)->update(['order_status_system' => 'DONE', 'order_is_complete' => 'Y', 'order_status_storage' => 'DONE']);
                 $addedNbr = RechargeService::disposeOrder($objectJson['order_id']);
-                
+
 
                 // throw new BusinessException("支付数据异常");
 //                return json_fail("");
@@ -131,19 +132,19 @@ class RechargeController
             $memberAccount->member_account_income = $income;
             $memberAccount->member_account_surplus = $memberAccount->member_account_surplus + $payAmount;
             $memberAccount->save();
-           
+
             // 根据最新的数据,更新用户等级
             // 临时屏蔽该会员升级
-            if (!in_array($payDetail->join_pay_member_id,['MR2409132254Z9VW'])) {
-                $member = Member::find($payDetail->join_pay_member_id);
-                $roleId = RechargeService::disposeRole($payDetail->join_pay_member_id, $payDetail->pay_amount);
-                if ($roleId && $member->join_member_role_id != $roleId) {
-                    $member->join_member_role_id = $roleId;
-                    $member->save();
-                    // 处理增值套包、组件
-                    RechargeService::disposeAdded($roleId, $payDetail->join_pay_member_id);
-                }
-            }
+//            if (!in_array($payDetail->join_pay_member_id, ['MR2409132254Z9VW'])) {
+//                $member = Member::find($payDetail->join_pay_member_id);
+//                $roleId = RechargeService::disposeRole($payDetail->join_pay_member_id, $payDetail->pay_amount);
+//                if ($roleId && $member->join_member_role_id != $roleId) {
+//                    $member->join_member_role_id = $roleId;
+//                    $member->save();
+//                    // 处理增值套包、组件
+//                    RechargeService::disposeAdded($roleId, $payDetail->join_pay_member_id);
+//                }
+//            }
             Db::commit();
 
             return json_success('success');

+ 4 - 4
app/admin/controller/order/GoodsController.php

@@ -553,7 +553,7 @@ class GoodsController extends Curd
             // 会员升级
             if (!empty($params['order_is_complete']) && $params['order_is_complete'] == 'Y' && $params['order_status_payment'] == 'SUCCESS') {
                 Event::dispatch('order.complete', $params);
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
             }
 
             if ($params['settlement_now'] == 'Y' && $params['order_status_payment'] != 'SUCCESS') {
@@ -881,7 +881,7 @@ class GoodsController extends Curd
             // 会员升级
             if (!empty($params['order_is_complete']) && $params['order_is_complete'] == 'Y' && $params['order_status_payment'] == 'SUCCESS') {
                 Event::dispatch('order.complete', $params);
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
             }
 
             if ($params['settlement_now'] == 'Y' && $params['order_status_payment'] != 'SUCCESS') {
@@ -1317,7 +1317,7 @@ class GoodsController extends Curd
                 // 完成订单
                 Event::dispatch('order.complete', $params);
                 // 会员升级
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
             }
             if ($order->order_status_payment == 'SUCCESS') {
                 // 上级提成
@@ -1677,7 +1677,7 @@ class GoodsController extends Curd
                 // 完成订单
                 Event::dispatch('order.complete', $params);
                 // 会员升级
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
             }
             if ($order->order_status_payment == 'SUCCESS') {
                 // 上级提成

+ 4 - 4
app/admin/controller/order/PackagesController.php

@@ -692,7 +692,7 @@ class PackagesController extends Curd
             // 会员升级
             if (!empty($params['order_is_complete']) && $params['order_is_complete'] == 'Y' && $params['order_status_payment'] == 'SUCCESS') {
                 Event::dispatch('order.complete', $params);
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
             }
 
             if ($params['settlement_now'] == 'Y' && $params['order_status_payment'] != 'SUCCESS') {
@@ -1018,7 +1018,7 @@ class PackagesController extends Curd
             // 会员升级
             if (!empty($params['order_is_complete']) && $params['order_is_complete'] == 'Y' && $params['order_status_payment'] == 'SUCCESS') {
                 Event::dispatch('order.complete', $params);
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
             }
 
             if ($params['settlement_now'] == 'Y' && $params['order_status_payment'] != 'SUCCESS') {
@@ -1501,7 +1501,7 @@ class PackagesController extends Curd
                 // 完成订单
                 Event::dispatch('order.complete', $params);
                 // 会员升级
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
             }
             if ($order->order_status_payment == 'SUCCESS') {
                 // 上级提成
@@ -1910,7 +1910,7 @@ class PackagesController extends Curd
                 // 完成订单
                 Event::dispatch('order.complete', $params);
                 // 会员升级
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
             }
             if ($order->order_status_payment == 'SUCCESS') {
                 // 上级提成

+ 4 - 4
app/admin/controller/order/ServicesController.php

@@ -535,7 +535,7 @@ class ServicesController extends Curd
             // 会员升级
             if (!empty($params['order_is_complete']) && $params['order_is_complete'] == 'Y' && $params['order_status_payment'] == 'SUCCESS') {
                 Event::dispatch('order.complete', $params);
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
             }
 
             if ($params['settlement_now'] == 'Y' && $params['order_status_payment'] != 'SUCCESS') {
@@ -862,7 +862,7 @@ class ServicesController extends Curd
             // 会员升级
             if (!empty($params['order_is_complete']) && $params['order_is_complete'] == 'Y' && $params['order_status_payment'] == 'SUCCESS') {
                 Event::dispatch('order.complete', $params);
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
             }
 
             if ($params['settlement_now'] == 'Y' && $params['order_status_payment'] != 'SUCCESS') {
@@ -1367,7 +1367,7 @@ class ServicesController extends Curd
                 // 完成订单
                 Event::dispatch('order.complete', $params);
                 // 会员升级
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
             }
             if ($order->order_status_payment == 'SUCCESS') {
                 // 上级提成
@@ -1797,7 +1797,7 @@ class ServicesController extends Curd
                 // 完成订单
                 Event::dispatch('order.complete', $params);
                 // 会员升级
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
             }
             if ($order->order_status_payment == 'SUCCESS') {
                 // 上级提成

+ 5 - 5
app/admin/controller/order/WholeController.php

@@ -1288,7 +1288,7 @@ class WholeController extends Curd
                 // 完成订单
                 Event::dispatch('order.complete', $params);
                 // 会员升级
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
                 // 上级提成
                 Event::dispatch('commission.order', $params);
             }
@@ -1746,7 +1746,7 @@ class WholeController extends Curd
                 // 完成订单
                 Event::dispatch('order.complete', $params);
                 // 会员升级
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
                 // 上级提成
                 Event::dispatch('commission.order', $params);
             }
@@ -2468,7 +2468,7 @@ class WholeController extends Curd
                 // 订单完成
                 Event::dispatch('order.complete', $params);
                 // 会员升级
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
                 // 上级提成
                 Event::dispatch('commission.order', $params);
             }
@@ -3025,7 +3025,7 @@ class WholeController extends Curd
                 // 完成订单
                 Event::dispatch('order.complete', $params);
                 // 会员升级
-                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
+//                Event::dispatch('order_pay.member_level.up', $params['join_order_member_id']);
                 // 上级提成
                 Event::dispatch('commission.order', $params);
             }
@@ -3661,7 +3661,7 @@ class WholeController extends Curd
             if ($params['express_type'] == '自提') {
                 $order = Order::where('order_id', $request->post('order_id'))->select('join_order_member_id')->first();
                 if (!empty($order)) {
-                    Event::dispatch('order_pay.member_level.up', $order->join_order_member_id);
+//                    Event::dispatch('order_pay.member_level.up', $order->join_order_member_id);
                 }
             }
 

+ 3 - 3
app/admin/service/member/MemberService.php

@@ -951,9 +951,9 @@ class MemberService
                         $extendJson['added_amount'] = 0;
                     }
                     // 计划任务还没跑
-                    if ($item['pay_category'] == 'RECHARGE' && (!isset($extendJson['notify']) || $extendJson['notify'] != 'success')) {
-                        continue;
-                    }
+//                    if ($item['pay_category'] == 'RECHARGE' && (!isset($extendJson['notify']) || $extendJson['notify'] != 'success')) {
+//                        continue;
+//                    }
                     if (isset($extendJson['added_amount']) && floatval($extendJson['added_amount']) > 0) {
                         $data[] = [
                             'join_pay_member_id' => $item['join_pay_member_id'],

+ 1 - 0
app/event/MemberLevelEvent.php

@@ -14,6 +14,7 @@ class MemberLevelEvent
 {
     public function payOrderLevelUp($memberId)
     {
+        return json_success('不升级了');
         Db::beginTransaction();
         try {
             $member = Member::where('member_id', $memberId)->select('member_id', 'join_member_role_id', 'member_mobile')->first();

+ 47 - 47
app/event/order/CommissionEvent.php

@@ -45,53 +45,53 @@ class CommissionEvent
 //}
     public function order($params)
     {
-        // 提设置
-        $config = SysConfig::where('config_key', 'app-identity-partner-config')->first();
-        $configParams = json_decode($config->config_value_json, true);
-        Db::beginTransaction();
-        try {
-            $order = Order::where('order_id', $params['orderId'])->where('order_status_payment', 'SUCCESS')->first();
-            // 有传过来的
-            if (!empty($params['join_invite_member_id'])) {
-                $inviteMemberId = $params['join_invite_member_id'];
-            } else {
-                // 下单人
-                $member = Member::where('member_id', $order->join_order_member_id)->first();
-                if (empty($member->join_invite_member_id)) {
-                    throw new BusinessException("没有直属上级");
-                }
-                $inviteMemberId = $member->join_invite_member_id;
-            }
-            // 上级
-            $memberUp = Member::where('member_id', $inviteMemberId)->first();
-            if ($memberUp->member_is_partner == 'Y') {
-                $identity = 'PARTNER';
-            } elseif ($memberUp->member_is_referrer == 'Y') {
-                $identity = 'REFERRER';
-            }else{
-                throw new BusinessException("直属上级非合伙人或者推荐官");
-            }
-            // 记录的JSON
-            $accountListJson = [
-                'line' => 'relate-consum',
-                'amount' => $order->order_amount_pay,
-                'identity' => $identity,
-                'order_id' => $order->order_id,
-                'master_member_id' => $order->join_order_member_id
-            ];
-            // 提成
-            $this->commissionToMember($inviteMemberId, $accountListJson, round($configParams['commission']['relate-consum'] * $order->order_amount_pay, 2), '消费');
-
-            Db::commit();
-            _syslog("提成", "计算提成成功");
-        } catch (BusinessException $e) {
-            Db::rollBack();
-            _syslog("提成", "计算提成失败:" . $e->getMessage());
-        } catch (\Exception $e) {
-            dump($e->getMessage());
-            Db::rollBack();
-            _syslog("提成", "计算提成失败");
-        }
+        // 提设置
+//        $config = SysConfig::where('config_key', 'app-identity-partner-config')->first();
+//        $configParams = json_decode($config->config_value_json, true);
+//        Db::beginTransaction();
+//        try {
+//            $order = Order::where('order_id', $params['orderId'])->where('order_status_payment', 'SUCCESS')->first();
+//            // 有传过来的
+//            if (!empty($params['join_invite_member_id'])) {
+//                $inviteMemberId = $params['join_invite_member_id'];
+//            } else {
+//                // 下单人
+//                $member = Member::where('member_id', $order->join_order_member_id)->first();
+//                if (empty($member->join_invite_member_id)) {
+//                    throw new BusinessException("没有直属上级");
+//                }
+//                $inviteMemberId = $member->join_invite_member_id;
+//            }
+//            // 上级
+//            $memberUp = Member::where('member_id', $inviteMemberId)->first();
+//            if ($memberUp->member_is_partner == 'Y') {
+//                $identity = 'PARTNER';
+//            } elseif ($memberUp->member_is_referrer == 'Y') {
+//                $identity = 'REFERRER';
+//            }else{
+//                throw new BusinessException("直属上级非合伙人或者推荐官");
+//            }
+//            // 记录的JSON
+//            $accountListJson = [
+//                'line' => 'relate-consum',
+//                'amount' => $order->order_amount_pay,
+//                'identity' => $identity,
+//                'order_id' => $order->order_id,
+//                'master_member_id' => $order->join_order_member_id
+//            ];
+//            // 提成
+//            $this->commissionToMember($inviteMemberId, $accountListJson, round($configParams['commission']['relate-consum'] * $order->order_amount_pay, 2), '消费');
+//
+//            Db::commit();
+//            _syslog("提成", "计算提成成功");
+//        } catch (BusinessException $e) {
+//            Db::rollBack();
+//            _syslog("提成", "计算提成失败:" . $e->getMessage());
+//        } catch (\Exception $e) {
+//            dump($e->getMessage());
+//            Db::rollBack();
+//            _syslog("提成", "计算提成失败");
+//        }
     }
 
     /**