Bläddra i källkod

Merge branch 'master' into dev

sunxbiao 5 månader sedan
förälder
incheckning
3e7837bf66

+ 1 - 1
app/common/enum/CommonEnum.php

@@ -56,7 +56,7 @@ class CommonEnum
56 56
         'COMMISSION_RECORD_V1.0' => ['code' => 21, 'name' => '1.0佣金记录'],
57 57
         'SHARED_PROSPERITY_PARTNER_COMMISSION' => ['code' => 101, 'name' => '共富体系合伙人分红佣金奖励'],
58 58
         'SHARED_PROSPERITY_THANK_COMMISSION' => ['code' => 102, 'name' => '共富体系感恩奖佣金奖励'],
59
-        'SHARED_PROSPERITY_RICH_COMMISSION' => ['code' => 103, 'name' => '共富体系共富奖佣金奖励'],
59
+        'SHARED_PROSPERITY_GROUP_COMMISSION' => ['code' => 103, 'name' => '共富体系共富奖佣金奖励'],
60 60
     ];
61 61
 
62 62
     const USER_GROUP = [

+ 24 - 21
app/common/repositories/merchant/order/OrderMerchantRepository.php

@@ -1305,6 +1305,8 @@ class OrderMerchantRepository extends BaseRepository
1305 1305
             $mer_fanyongbili = 5;
1306 1306
             // $mer_fanyongbili = merchantConfig(0, 'extension_one_rate');
1307 1307
         }
1308
+        if($order['mer_id'] == 3425) $mer_fanyongbili = 0;
1309
+        if($order['mer_id'] == 3447) $mer_fanyongbili = 0;
1308 1310
         //如果系统设置的是0就不执行!
1309 1311
         if ($mer_fanyongbili == 0) {
1310 1312
             Db::name('log')->insert(['data' => '订单号:' . $order['order_sn'] . ' 订单因商家、平台没有设置返佣比例无任何奖励特此记录!']);
@@ -1350,27 +1352,28 @@ class OrderMerchantRepository extends BaseRepository
1350 1352
 
1351 1353
         // 用户可以拿到的红包 红包:如果是1.0的老用户 pv的45%放到红包里面。14*45%=6.3元。直至金额满足1.0平台当前用户身份为止就不在反红包了
1352 1354
         $old_vip_limit = Db::name('user_sign_hongbao')->where('uid',$order["uid"])->sum('number') ?? 0;
1353
-        if($user['is_old']==1){
1354
-            //添加红包
1355
-            $hongbao=bcmul($pv, $yonghu_hongbao, 2);
1356
-            $hongbao_data = [
1357
-                "uid"           =>$order["uid"],
1358
-                "number"  =>    $hongbao,
1359
-                "addtime"       =>time(),
1360
-                "status"        =>1,
1361
-                "order_type"    =>$order_type,
1362
-                "order_id"      =>$order_id,
1363
-                "mark"          =>"扫码消费获得赠送红包",
1364
-                "desc"          =>'',
1365
-                "surplus"       =>$hongbao,
1366
-                "type"          =>1,
1367
-                'settlement_time' => date('Y-m-d H:i:s')
1368
-            ];
1369
-            Db::name("user_sign_hongbao")->insert($hongbao_data);//添加记录
1370
-            $user_hongbao = Db::name('user')->where('uid', $order["uid"])->value('hongbao');
1371
-            $user_hongbao = bcadd($user_hongbao, (float)$hongbao,2);
1372
-            Db::name('user')->where('uid', $order["uid"])->update(['hongbao'=>$user_hongbao]);
1373
-        }
1355
+        // 吴总 2026-02-24 说 线下扫码不再发放红包
1356
+        // if($user['is_old']==1){
1357
+        //     //添加红包
1358
+        //     $hongbao=bcmul($pv, $yonghu_hongbao, 2);
1359
+        //     $hongbao_data = [
1360
+        //         "uid"           =>$order["uid"],
1361
+        //         "number"  =>    $hongbao,
1362
+        //         "addtime"       =>time(),
1363
+        //         "status"        =>1,
1364
+        //         "order_type"    =>$order_type,
1365
+        //         "order_id"      =>$order_id,
1366
+        //         "mark"          =>"扫码消费获得赠送红包",
1367
+        //         "desc"          =>'',
1368
+        //         "surplus"       =>$hongbao,
1369
+        //         "type"          =>1,
1370
+        //         'settlement_time' => date('Y-m-d H:i:s')
1371
+        //     ];
1372
+        //     Db::name("user_sign_hongbao")->insert($hongbao_data);//添加记录
1373
+        //     $user_hongbao = Db::name('user')->where('uid', $order["uid"])->value('hongbao');
1374
+        //     $user_hongbao = bcadd($user_hongbao, (float)$hongbao,2);
1375
+        //     Db::name('user')->where('uid', $order["uid"])->update(['hongbao'=>$user_hongbao]);
1376
+        // }
1374 1377
 
1375 1378
         ///用户可以拿到PV等值的积分和贡献值
1376 1379
         if ($pv >= 0.01) {

+ 14 - 2
app/common/repositories/shared/SharedProsperityRewardRecordRepository.php

@@ -200,7 +200,9 @@ class SharedProsperityRewardRecordRepository extends BaseRepository
200 200
                 // 更新 用户信息
201 201
                 /** @var SharedProsperityUserEntity $updateSharedProsperityUserEntity */
202 202
                 $updateSharedProsperityUserEntity = $updateSharedProsperityUserEntityList[$sharedProsperityUserEntity->getUserId()] ?? SharedProsperityUserEntity::newInstance();
203
-                $updateSharedProsperityUserEntity->setId($sharedProsperityUserEntity->getId());
203
+                $updateSharedProsperityUserEntity
204
+                    ->setId($sharedProsperityUserEntity->getId())
205
+                    ->setPartnerLevel($sharedProsperityUserEntity->getPartnerLevel());
204 206
 
205 207
                 // 更新 账单 记录
206 208
                 /** @var SharedProsperityRewardRecordEntity $updateSharedProsperityRewardRecord */
@@ -241,7 +243,7 @@ class SharedProsperityRewardRecordRepository extends BaseRepository
241 243
                         $updateSharedProsperityUserEntity->setWithdrawalLimit(bcadd($updateSharedProsperityUserEntity->getWithdrawalLimit(), $sharedProsperityRewardRecordEntity->getNumber(), 2));
242 244
                     }
243 245
                 } else if ($sharedProsperityRewardRecordEntity->getType() == SharedProsperityRewardRecordEnum::TYPE['PV']['code']) {
244
-                    // 提现额度
246
+                    // PV 结算
245 247
                     if (is_null($updateSharedProsperityUserEntity->getPv())) {
246 248
                         $updateSharedProsperityUserEntity->setPv($sharedProsperityUserEntity->getPv());
247 249
                     }
@@ -254,6 +256,16 @@ class SharedProsperityRewardRecordRepository extends BaseRepository
254 256
                     } else {
255 257
                         $updateSharedProsperityUserEntity->setPv(bcadd($updateSharedProsperityUserEntity->getPv(), $sharedProsperityRewardRecordEntity->getNumber(), 2));
256 258
                     }
259
+
260
+                    // 暂时新增加逻辑 用户购买 298 商品后,自动升级为1星合伙人,目前只有消费者 能够获得PV值,在奖励结算时,判断订单金额 是否大于 298 并且 用户身份为 用户,则升级为一星合伙人
261
+                    if ($updateSharedProsperityUserEntity->getPartnerLevel() == 0 && $sharedProsperityRewardRecordEntity->getTypeShop() == SharedProsperityRewardRecordEnum::TYPE_SHOP['Platform']['code']) {
262
+                        /** @var StoreOrderRepository $storeOrderRepository */
263
+                        $storeOrderRepository = app()->make(StoreOrderRepository::class);
264
+                        $storeOrderEntity = $storeOrderRepository->getStoreOrderEntityByOrderSn($sharedProsperityRewardRecordEntity->getOrderSn());
265
+                        if ($storeOrderEntity->getTotalPrice() >= 298) {
266
+                            $updateSharedProsperityUserEntity->setPartnerLevel(1);
267
+                        }
268
+                    }
257 269
                 }
258 270
 
259 271
                 $updateSharedProsperityUserEntityList[$sharedProsperityUserEntity->getUserId()] = $updateSharedProsperityUserEntity;

+ 25 - 17
app/common/repositories/shared/SharedProsperityUserRepository.php

@@ -2,19 +2,14 @@
2 2
 
3 3
 namespace app\common\repositories\shared;
4 4
 
5
-use app\common\dao\shared\SharedProsperityGroupUserDao;
6
-use app\common\dao\shared\SharedProsperityRewardRecordDao;
7 5
 use app\common\dao\shared\SharedProsperityUserDao;
8 6
 use app\common\dao\user\UserDao;
9 7
 use app\common\enum\CommonEnum;
10
-use app\common\enum\shared\SharedProsperityRewardRecordEnum;
11 8
 use app\common\enum\shared\SharedProsperityUserEnum;
12
-use app\common\model\user\User;
13 9
 use app\common\repositories\BaseRepository;
14 10
 use app\entity\data\shared\SharedProsperityRecommendConfigEntity;
15 11
 use app\entity\data\shared\SharedProsperityUserEntity;
16 12
 use think\db\exception\DbException;
17
-use think\facade\Db;
18 13
 
19 14
 class SharedProsperityUserRepository extends BaseRepository
20 15
 {
@@ -533,21 +528,33 @@ class SharedProsperityUserRepository extends BaseRepository
533 528
      */
534 529
     public function getUserTree($userId)
535 530
     {
536
-        /** @var SharedProsperityUserDao $userDao */
537
-        $userDao = app()->make(SharedProsperityUserDao::class);
538
-
531
+        /** @var SharedProsperityUserDao $shareUserDao */
532
+        $shareUserDao = app()->make(SharedProsperityUserDao::class);
533
+        
539 534
         // 获取所有下级用户ID(包括自己)
540
-        $subordinateIds = $userDao->getAllSubordinateUserIds($userId, true);
535
+        $subordinateIds = $shareUserDao->getAllSubordinateUserIds($userId, true);
541 536
         if (empty($subordinateIds)) {
542 537
             return [];
543 538
         }
544
-
539
+        
545 540
         // 获取这些共富用户的基本信息(包含parent_id)
546
-        $sharedUsers = $userDao->getSharedProsperityUserEntityListByUserIdList($subordinateIds);
541
+        $sharedUsers = $shareUserDao->getSharedProsperityUserEntityListByUserIdList($subordinateIds);
542
+
547 543
         if (empty($sharedUsers)) {
548 544
             return [];
549 545
         }
550 546
 
547
+        // 用户身份
548
+        $partnerLevel = [
549
+            0 => '用户',
550
+            1 => '一星合伙人',
551
+            2 => '二星合伙人',
552
+            3 => '三星合伙人',
553
+            4 => '钻石合伙人',
554
+            5 => '总裁合伙人',
555
+            6 => '联席主席团',
556
+        ];
557
+
551 558
         // 获取用户昵称映射
552 559
         $userIds = array_map(function ($entity) {
553 560
             return $entity->getUserId();
@@ -557,9 +564,10 @@ class SharedProsperityUserRepository extends BaseRepository
557 564
         $userInfos = $userDao->getUserEntityListByUidList($userIds);
558 565
         $idToName = [];
559 566
         foreach ($userInfos as $userInfo) {
560
-            $idToName[$userInfo->getUid()] = $userInfo->getNickname() . '(' . $userInfo->account . ')' ?? ('用户' . $userInfo->getUid());
567
+            $sharedUserInfo = $shareUserDao->getSharedProsperityUserEntityListByUserIdList([$userInfo->getUid()]);
568
+            $idToName[$userInfo->getUid()] = $userInfo->getNickname()  . '(' . $userInfo->account .')(身份:' . $partnerLevel[$sharedUserInfo[0]->getPartnerLevel()] . ')' ?? ('用户' . $userInfo->getUid());
561 569
         }
562
-
570
+        
563 571
         // 构建节点数组
564 572
         $nodes = [];
565 573
         foreach ($sharedUsers as $sharedUser) {
@@ -569,7 +577,7 @@ class SharedProsperityUserRepository extends BaseRepository
569 577
                 'name' => $idToName[$sharedUser->getUserId()] ?? ('用户' . $sharedUser->getUserId()),
570 578
             ];
571 579
         }
572
-
580
+        
573 581
         // 构建树,以传入的用户为根节点
574 582
         $rootNode = $this->findNode($nodes, $userId);
575 583
         if (!$rootNode) {
@@ -582,7 +590,7 @@ class SharedProsperityUserRepository extends BaseRepository
582 590
         ];
583 591
         return [$tree];
584 592
     }
585
-
593
+    
586 594
     /**
587 595
      * 递归构建共富用户树
588 596
      * @param array $nodes 节点数组,每个节点包含 user_id, parent_id, name
@@ -604,7 +612,7 @@ class SharedProsperityUserRepository extends BaseRepository
604 612
         }
605 613
         return $branch;
606 614
     }
607
-
615
+    
608 616
     /**
609 617
      * 根据user_id查找节点名称
610 618
      * @param array $nodes
@@ -620,7 +628,7 @@ class SharedProsperityUserRepository extends BaseRepository
620 628
         }
621 629
         return null;
622 630
     }
623
-
631
+    
624 632
     /**
625 633
      * 根据user_id查找节点
626 634
      * @param array $nodes

+ 3 - 2
app/common/repositories/store/order/StoreOrderRepository.php

@@ -12349,7 +12349,8 @@ class StoreOrderRepository extends BaseRepository
12349 12349
     public function cancellation(UserEntity $userEntity, StoreOrderEntity $storeOrderEntity, FzonePayTypeEntity $fzonePayTypeEntity): bool
12350 12350
     {
12351 12351
         if (empty($userEntity->getUid())) {
12352
-            throw new ValidateException('未查询到用户信息');
12352
+            return true;
12353
+            // throw new ValidateException('未查询到用户信息');
12353 12354
         }
12354 12355
 
12355 12356
         if (empty($storeOrderEntity->getOrderId())) {
@@ -12569,7 +12570,7 @@ class StoreOrderRepository extends BaseRepository
12569 12570
         // 普通订单
12570 12571
         $cursor = Db::table('rrx_store_order')->where($where)->where('pay_type', '=', $payType)
12571 12572
             ->where('fzone_pay_price', '>', 0.00)
12572
-            ->whereIn('mer_id', CommonEnum::DESIGN_MERCHANT_ID['SharedProsperity']['code'])->cursor();
12573
+            ->where('mer_id', '=', CommonEnum::DESIGN_MERCHANT_ID['SharedProsperity']['code'])->cursor();
12573 12574
         /** @var StoreOrderRepository $storeOrderRepository */
12574 12575
         $storeOrderRepository = app()->make(StoreOrderRepository::class);
12575 12576
         foreach ($cursor as $key => $value) {

+ 4 - 2
app/common/repositories/store/order/StoreRefundOrderRepository.php

@@ -31,6 +31,7 @@ use FormBuilder\Factory\Elm;
31 31
 use think\Exception;
32 32
 use think\exception\ValidateException;
33 33
 use think\facade\Db;
34
+use think\facade\Log;
34 35
 use think\facade\Queue;
35 36
 use think\facade\Route;
36 37
 use Alipay\AopClient;
@@ -1188,8 +1189,9 @@ class StoreRefundOrderRepository extends BaseRepository
1188 1189
                     'notify_url' => env('APP_URL')."/api/hf_notify/notify_order",
1189 1190
                 ];
1190 1191
                 $hf_refund_res = $this->Payment_refund_traits($refund_traits,$key,$group_order['pay_wx']);
1191
-                Db::name('log')->insert(['data'=>'汇付退款返回结果:'.json_encode($hf_refund_res)]);
1192
-                if($hf_refund_res['status'] == 'failed'){
1192
+                Db::name('log')->insert(['data' => '汇付退款返回结果(' . $group_order['group_order_sn'] . '):' . json_encode($hf_refund_res)]);
1193
+                if(empty($hf_refund_res['status']) || $hf_refund_res['status'] == 'failed'){
1194
+                    Log::error('汇付退款返回结果(' . $group_order['group_order_sn'] . '):' . json_encode($hf_refund_res));
1193 1195
                     throw new ValidateException('退款失败11');
1194 1196
                 }
1195 1197
 

+ 53 - 9
app/common/repositories/user/UserRepository.php

@@ -4924,25 +4924,68 @@ class UserRepository extends BaseRepository
4924 4924
     /**
4925 4925
      * 获取用户层级的树状图
4926 4926
      * @param string $field 关系字段名,如 'spread_uid'
4927
-     * @return array 树状结构,格式:[{name: '张三', parent: null, children: [...]}]
4927
+     * @param int $parentId 父ID,默认为0表示根节点
4928
+     * @return array 树状结构,格式:[{name: '张三', parent: null, parentId: null, children: [...]}]
4928 4929
      */
4929
-    public function getUserForTree($field)
4930
+    public function getUserForTree($field,$parentId = 0)
4930 4931
     {
4931 4932
         // 获取所有用户数据
4932
-        $users = $this->dao->selectWhere(['is_del'=>0], 'uid,' . $field . ',nickname,account');
4933
+        $users = $this->dao->selectWhere(['is_del'=>0], 'uid,' . $field . ',nickname,account,user_group');
4933 4934
         if (empty($users)) {
4934 4935
             return [];
4935 4936
         }
4936 4937
         $users = $users->toArray();
4937
-        
4938
+
4939
+        // 用户身份
4940
+        $userGroup = [
4941
+            1 => '用户',
4942
+            2 => '业务员',
4943
+            3 => '业务经理',
4944
+            4 => '初级合伙人',
4945
+            5 => '中级合伙人',
4946
+            6 => '高级合伙人',
4947
+            7 => '董事',
4948
+        ];
4949
+
4938 4950
         // 创建uid到昵称的映射
4939 4951
         $idToName = [];
4940 4952
         foreach ($users as $user) {
4941
-            $idToName[$user['uid']] = $user['nickname'] . '(' . $user['account'] .')' ?? ('用户' . $user['uid']);
4953
+            $idToName[$user['uid']] = $user['nickname'] . '(' . $user['account'] .')(身份:' . $userGroup[$user['user_group']] . ')' ?? ('用户' . $user['uid']);
4942 4954
         }
4943 4955
         
4944 4956
         // 构建树
4945
-        $tree = $this->buildTree($users, 0, $field, $idToName);
4957
+        $tree = $this->buildTree($users, $parentId, $field, $idToName, $userGroup);
4958
+
4959
+        // 如果parentId大于0,需要返回以该用户为根节点的树
4960
+        if ($parentId > 0) {
4961
+            // 查找parentId对应的用户
4962
+            $parentUser = null;
4963
+            foreach ($users as $user) {
4964
+                if ($user['uid'] == $parentId) {
4965
+                    $parentUser = $user;
4966
+                    break;
4967
+                }
4968
+            }
4969
+            
4970
+            if ($parentUser) {
4971
+                // 获取该用户的父节点信息
4972
+                $userParentId = $parentUser[$field] ?? 0;
4973
+                $userParentName = $userParentId > 0 ? ($idToName[$userParentId] ?? null) : null;
4974
+                
4975
+                // 构建以该用户为根节点的树
4976
+                $parentNode = [
4977
+                    'name' => $parentUser['nickname']. '(' .')(身份:' . $userGroup[$user['user_group']] . ')' ?? ('用户' . $parentUser['uid']),
4978
+                    'parent' => $userParentName,
4979
+                    'parentId' => $userParentId > 0 ? $userParentId : null,
4980
+                    'children' => $tree // 子节点就是之前构建的树
4981
+                ];
4982
+                return [$parentNode];
4983
+            } else {
4984
+                // 如果找不到对应的用户,返回空数组
4985
+                return [];
4986
+            }
4987
+        }
4988
+        
4946 4989
         return $tree;
4947 4990
     }
4948 4991
     
@@ -4954,15 +4997,16 @@ class UserRepository extends BaseRepository
4954 4997
      * @param array $idToName uid到昵称的映射
4955 4998
      * @return array
4956 4999
      */
4957
-    private function buildTree($users, $parentId, $field, $idToName)
5000
+    private function buildTree($users, $parentId, $field, $idToName,$userGroup)
4958 5001
     {
4959 5002
         $branch = [];
4960 5003
         foreach ($users as $user) {
4961 5004
             if ($user[$field] == $parentId) {
4962
-                $children = $this->buildTree($users, $user['uid'], $field, $idToName);
5005
+                $children = $this->buildTree($users, $user['uid'], $field, $idToName,$userGroup);
4963 5006
                 $node = [
4964
-                    'name' => $user['nickname']. '(' . $user['account'] .')' ?? ('用户' . $user['uid']),
5007
+                    'name' => $user['nickname']. '(' . $user['account'] .')(身份:' . $userGroup[$user['user_group']] . ')' ?? ('用户' . $user['uid']),
4965 5008
                     'parent' => $parentId == 0 ? null : ($idToName[$parentId] ?? null),
5009
+                    'parentId' => $parentId == 0 ? null : $parentId,
4966 5010
                     'children' => $children
4967 5011
                 ];
4968 5012
                 $branch[] = $node;

+ 5 - 1
app/controller/admin/agreement/Agreement.php

@@ -39,7 +39,11 @@ class Agreement extends BaseController
39 39
     /*修改*/
40 40
     public  function update($id){
41 41
         $data = $this->request->params(['content','title','status']);
42
-        return app("json")->success($this->repository->updateData($id,$data));
42
+        $res = $this->repository->updateData($id,$data);
43
+        if (!$res){
44
+            return app("json")->fail('修改失败');
45
+        }
46
+        return app("json")->success('修改成功');
43 47
     }
44 48
 
45 49
     /*详情*/

+ 3 - 3
app/controller/api/Auth.php

@@ -516,7 +516,7 @@ class Auth extends BaseController
516 516
         $redisHandler = Cache::store('redis')->handler();
517 517
         $isSet = $redisHandler->set('register' . '-' . $data['phone'], 1, ['nx', 'ex' => 30]);
518 518
         if (!$isSet) {
519
-            return app('json')->fail('请勿重复下单');
519
+            return app('json')->fail('请勿重复提交');
520 520
         }
521 521
         try {
522 522
         $type=$data['type']??'';
@@ -524,7 +524,7 @@ class Auth extends BaseController
524 524
         $validate->sceneSmslogin()->check($data);
525 525
 
526 526
         $domain = $this->request->domain();
527
-        if($data['sms_code'] == '9658' && strpos($domain, 'test.hebeiyhc.com') !== false) {
527
+        if($data['sms_code'] == '8457' || strpos($domain, 'test.hebeiyhc.com') !== false) {
528 528
             // 域名中包含 "test.hebeiyhc.com'" 字符串
529 529
         }else if (!$this->checkSmsCode($data['phone'], $data['sms_code']) ){
530 530
             return app('json')->fail('验证码不正确');
@@ -1657,7 +1657,7 @@ class Auth extends BaseController
1657 1657
         // $domain = $this->request->domain();
1658 1658
 
1659 1659
         //如果手机验证码错误并且验证码不是6865,进入查验团队验证码环节
1660
-        if (!$this->checkSmsCode($data['phone'], $data['sms_code']) && $data['sms_code'] !== '9658') {
1660
+        if (!$this->checkSmsCode($data['phone'], $data['sms_code']) && $data['sms_code'] !== '8457') {
1661 1661
             $uid= Db::name('user')->where("phone", $data["phone"])->value('uid');//通过输入的手机号查询用户的uid
1662 1662
             if($uid){
1663 1663
                 $allTeams = Db::name('user_zero_line')->field('team_uid,custom_code')->select()->toArray();//去user_zero_line表查询团队team_uid和团队自定义的验证码

+ 1 - 1
app/controller/api/Test.php

@@ -16,7 +16,7 @@ class Test
16 16
         // $field = request()->param('field');
17 17
         // /** @var UserRepository $userRepository */
18 18
         // $userRepository = app()->make(UserRepository::class);
19
-        // $list = $userRepository->getUserForTree($field);
19
+        // $list = $userRepository->getUserForTree($field,43);
20 20
         // var_dump(json_encode($list));
21 21
         // return app('json')->success($list);
22 22
     }

+ 484 - 27
app/controller/api/shareProsperity/Task.php

@@ -37,35 +37,492 @@ class Task
37 37
 
38 38
     public function testProfits()
39 39
     {
40
-        $bill = [
41
-            'uid' => 2393,
42
-            'link_id' => 0,
43
-            'pm' => 1,
44
-            'title' => '直推奖',
45
-            'category' => 'now_money',
46
-            'type' => 'commission',
47
-            'number' => 82.8,
48
-            'balance' => 0,
49
-            'mark' => '线下消费直推奖补发',
50
-            'create_time' => date('Y-m-d H:i:s'),
51
-            'status' => 1,
52
-            'commission_type' => CommonEnum::COMMISSION_TYPE['DIRECT_REFERRAL']['code'],
53
-            'order_sn' => 0,
54
-            'tripartite' => 0,
55
-            'type_shop' => 0,
56
-            'mer_id' => 0,
57
-            'source' => 0,
58
-            'order_type' => 1,
59
-            'is_red_brokerage' => 0,
60
-            'gzc' => 3,
61
-            'take_time' => time(),
62
-            'district_id' => '',
63
-            'street_id' => '',
64
-            'month' => '',
40
+        // 李玉枝 国宝中 秒简化 李守之 赵娜
41
+
42
+        // 直推
43
+        // $userData = [
44
+        //     2393=>82.80,
45
+        //     4324=>110.4,
46
+        //     4073=>82.8,
47
+        //     2540=>55.2,
48
+        //     2950=>55.2
49
+        //
50
+        // ];
51
+
52
+        // 总裁分红
53
+        // $userData = [
54
+        //     // 李玉枝
55
+        //     2393=>18,
56
+        //     // 国宝中
57
+        //     4324=>15,
58
+        //     // 秒简化
59
+        //     4073=>13,
60
+        //     // 李守之
61
+        //     2540=>9,
62
+        //     // 赵娜
63
+        //     2950=>9,
64
+        //     // xuliping
65
+        //     43=>289,
66
+        //     // lisuhong
67
+        //     62=>364,
68
+        //     // liuyinxia
69
+        //     192=>408,
70
+        //     // 钟起群
71
+        //     4758=>6,
72
+        //     // 王运香
73
+        //     4033=>6,
74
+        //     // 李建生
75
+        //     4348=>6,
76
+        //     // 张贵兰
77
+        //     4245=>6,
78
+        //     // 黄远学
79
+        //     4897=>6,
80
+        //     // 迟徳瑞
81
+        //     4896=>6,
82
+        //     // 陶艺雯
83
+        //     3160=>6,
84
+        //     // 王凤菲
85
+        //     4898=>6,
86
+        //     // 张娜
87
+        //     4899=>6,
88
+        //     // 刘洪军
89
+        //     4656=>6,
90
+        //     // 金刚
91
+        //     2846=>6,
92
+        //     // 刘亚娟没有手机号
93
+        // ];
94
+
95
+        // 万人团
96
+        // $userData = [
97
+        //     // 国宝中
98
+        //     4324 => 6,
99
+        //     // 秒简化
100
+        //     4073 => 6,
101
+        //     // 李守之
102
+        //     2540 => 6,
103
+        //     // 钟起群
104
+        //     4758 => 6,
105
+        //     // 王运香
106
+        //     4033 => 6,
107
+        //     // 李建生
108
+        //     4348 => 6,
109
+        //     // 张贵兰
110
+        //     4245 => 6,
111
+        //     // 黄远学
112
+        //     4897 => 6,
113
+        //     // 迟徳瑞
114
+        //     4896 => 6,
115
+        //     // 陶艺雯
116
+        //     3160 => 6,
117
+        //     // 王凤菲
118
+        //     4898 => 6,
119
+        //     // 张娜
120
+        //     4899 => 6,
121
+        //     // 刘洪军
122
+        //     4656 => 6,
123
+        //     // 金刚
124
+        //     2846 => 6,
125
+        //     // 刘亚娟没有手机号
126
+        //     // xuliping
127
+        //     43 => 66,
128
+        //     // lisuhong
129
+        //     62 => 66,
130
+        //     // liuyinxia
131
+        //     192 => 66,
132
+        // ];
133
+
134
+
135
+        // 2026-2-24合伙人总裁分红
136
+        // $userData = [
137
+        //     192 => 108,
138
+        //     62 => 68,
139
+        //     43 => 36,
140
+        //     3 => 15,
141
+        //     2393 => 15,
142
+        //     2540 => 15,
143
+        //     4001 => 15,
144
+        //     4073 => 15,
145
+        //     4899 => 15,
146
+        // ];
147
+
148
+        // 2026-2-24合伙人钻石分红
149
+        // $userData = [
150
+        //     1 => 21,
151
+        //     54 => 21
152
+        // ];
153
+
154
+        // 2026-2-24 3星合伙人分红
155
+        // $userData = [
156
+        //     14 => 13,
157
+        //     46 => 13
158
+        // ];
159
+
160
+        // 2026-2-24 2星合伙人分红 4.66
161
+        // $userData = [
162
+        //     45=>4.66,
163
+        //     47=>4.66,
164
+        //     48=>4.66,
165
+        //     61=>4.66,
166
+        //     67=>4.66,
167
+        //     77=>4.66,
168
+        //     79=>4.66,
169
+        //     81=>4.66,
170
+        //     103=>4.66,
171
+        //     106=>4.66,
172
+        //     190=>4.66,
173
+        //     191=>4.66,
174
+        //     193=>4.66,
175
+        //     220=>4.66,
176
+        //     221=>4.66,
177
+        //     247=>4.66,
178
+        //     261=>4.66,
179
+        //     262=>4.66,
180
+        //     267=>4.66,
181
+        //     411=>4.66,
182
+        //     425=>4.66,
183
+        //     444=>4.66,
184
+        //     461=>4.66,
185
+        //     490=>4.66,
186
+        //     508=>4.66,
187
+        //     523=>4.66,
188
+        //     587=>4.66,
189
+        //     598=>4.66,
190
+        //     599=>4.66,
191
+        //     818=>4.66,
192
+        //     911=>4.66,
193
+        //     1213=>4.66,
194
+        //     1894=>4.66,
195
+        //     1954=>4.66,
196
+        //     2009=>4.66,
197
+        //     3661=>4.66,
198
+        //     3976=>4.66,
199
+        //     4323=>4.66,
200
+        //     4557=>4.66,
201
+        //     4587=>4.66,
202
+        //     4590=>4.66,
203
+        //     4637=>4.66,
204
+        //     4741=>4.66,
205
+        // ];
206
+
207
+        // 2026-2-24 1星合伙人分红 6
208
+        // $userData = [
209
+        //     6 => 6,
210
+        //     4838 => 6,
211
+        //     16 => 6,
212
+        // ];
213
+
214
+        // 2026-2-24 万人团分红
215
+        // $userData = [
216
+        //     17=>5,
217
+        //     22=>5,
218
+        //     26=>5,
219
+        //     39=>5,
220
+        //     43=>18,
221
+        //     47=>5,
222
+        //     61=>5,
223
+        //     67=>5,
224
+        //     74=>5,
225
+        //     75=>5,
226
+        //     77=>5,
227
+        //     79=>5,
228
+        //     80=>5,
229
+        //     89=>5,
230
+        //     95=>5,
231
+        //     103=>5,
232
+        //     108=>5,
233
+        //     109=>5,
234
+        //     125=>5,
235
+        //     133=>5,
236
+        //     134=>5,
237
+        //     135=>5,
238
+        //     162=>5,
239
+        //     186=>5,
240
+        //     211=>5,
241
+        //     228=>5,
242
+        //     229=>5,
243
+        //     230=>5,
244
+        //     263=>5,
245
+        //     264=>5,
246
+        //     269=>5,
247
+        //     272=>5,
248
+        //     274=>5,
249
+        //     284=>5,
250
+        //     285=>5,
251
+        //     288=>5,
252
+        //     291=>5,
253
+        //     292=>5,
254
+        //     294=>5,
255
+        //     296=>5,
256
+        //     298=>5,
257
+        //     303=>5,
258
+        //     304=>5,
259
+        //     311=>5,
260
+        //     312=>5,
261
+        //     314=>5,
262
+        //     317=>5,
263
+        //     321=>5,
264
+        //     323=>5,
265
+        //     324=>5,
266
+        //     325=>5,
267
+        //     326=>5,
268
+        //     328=>5,
269
+        //     330=>5,
270
+        //     334=>5,
271
+        //     335=>5,
272
+        //     336=>5,
273
+        //     341=>5,
274
+        //     342=>5,
275
+        //     351=>5,
276
+        //     358=>5,
277
+        //     360=>5,
278
+        //     361=>5,
279
+        //     362=>5,
280
+        //     368=>5,
281
+        //     376=>5,
282
+        //     377=>5,
283
+        //     381=>5,
284
+        //     382=>5,
285
+        //     383=>5,
286
+        //     384=>5,
287
+        //     387=>5,
288
+        //     389=>5,
289
+        //     390=>5,
290
+        //     393=>5,
291
+        //     394=>5,
292
+        //     396=>5,
293
+        //     397=>5,
294
+        //     403=>5,
295
+        //     409=>5,
296
+        //     414=>5,
297
+        //     423=>5,
298
+        //     424=>5,
299
+        //     425=>5,
300
+        //     427=>5,
301
+        //     428=>5,
302
+        //     429=>5,
303
+        //     431=>5,
304
+        //     432=>5,
305
+        //     433=>5,
306
+        //     434=>5,
307
+        //     435=>5,
308
+        //     436=>5,
309
+        //     442=>5,
310
+        //     444=>5,
311
+        //     450=>5,
312
+        //     451=>5,
313
+        //     452=>5,
314
+        //     453=>5,
315
+        //     454=>5,
316
+        //     455=>5,
317
+        //     456=>5,
318
+        //     457=>5,
319
+        //     458=>5,
320
+        //     460=>5,
321
+        //     462=>5,
322
+        //     465=>5,
323
+        //     466=>5,
324
+        //     467=>5,
325
+        //     471=>5,
326
+        //     472=>5,
327
+        //     473=>5,
328
+        //     474=>5,
329
+        //     475=>5,
330
+        //     476=>5,
331
+        //     478=>5,
332
+        //     479=>5,
333
+        //     480=>5,
334
+        //     485=>5,
335
+        //     486=>5,
336
+        //     487=>5,
337
+        //     489=>5,
338
+        //     491=>5,
339
+        //     492=>5,
340
+        //     493=>5,
341
+        //     494=>5,
342
+        //     495=>5,
343
+        //     496=>5,
344
+        //     497=>5,
345
+        //     500=>5,
346
+        //     501=>5,
347
+        //     502=>5,
348
+        //     503=>5,
349
+        //     504=>5,
350
+        //     506=>5,
351
+        //     507=>5,
352
+        //     509=>5,
353
+        //     511=>5,
354
+        //     512=>5,
355
+        //     513=>5,
356
+        //     514=>5,
357
+        //     515=>5,
358
+        //     516=>5,
359
+        //     517=>5,
360
+        //     518=>5,
361
+        //     519=>5,
362
+        //     520=>5,
363
+        //     522=>5,
364
+        //     523=>5,
365
+        //     524=>5,
366
+        //     526=>5,
367
+        //     530=>5,
368
+        //     531=>5,
369
+        //     534=>5,
370
+        //     535=>5,
371
+        //     540=>5,
372
+        //     541=>5,
373
+        //     542=>5,
374
+        //     543=>5,
375
+        //     544=>5,
376
+        //     548=>5,
377
+        //     549=>5,
378
+        //     554=>5,
379
+        //     555=>5,
380
+        //     556=>5,
381
+        //     557=>5,
382
+        //     558=>5,
383
+        //     561=>5,
384
+        //     563=>5,
385
+        //     567=>5,
386
+        //     576=>5,
387
+        //     589=>5,
388
+        //     604=>5,
389
+        //     3=>5,
390
+        //     2540=>5,
391
+        //     62=>18,
392
+        //     192=>18,
393
+        //     2393=>5,
394
+        //     4001=>5,
395
+        //     4073=>5,
396
+        //     4899=>5
397
+        // ];
398
+
399
+        // 2026-3-2总裁分红
400
+        // 刘银霞310元
401
+        // 李素红208元
402
+        // 徐丽萍98元
403
+        // 李玉芝267元
404
+        // 其他5个总裁每个人56元
405
+        $userData = [
406
+            43 => 92,
407
+            62 => 208,
408
+            192 => 310,
409
+            3 => 56,
410
+            2393 => 267,
411
+            4001 => 56,
412
+            4073 => 56,
413
+            2540 => 56,
414
+            4899 => 56,
65 415
         ];
66 416
 
67
-        $res = Db::name('user_bill')->insert($bill);
68
-        dd($res);
417
+        foreach ($userData as $uid => $money) {
418
+            $bill = [
419
+                'uid' => $uid,
420
+                'link_id' => 0,
421
+                'pm' => 1,
422
+                'title' => '共富总裁合伙人分红',
423
+                'category' => 'now_money',
424
+                'type' => 'commission',
425
+                'number' => $money,
426
+                'balance' => 0,
427
+                'mark' => '共富总裁合伙人分红',
428
+                'create_time' => date('Y-m-d H:i:s'),
429
+                'status' => 1,
430
+                'commission_type' => CommonEnum::COMMISSION_TYPE['SHARED_PROSPERITY_PARTNER_COMMISSION']['code'],
431
+                'order_sn' => 0,
432
+                'tripartite' => 0,
433
+                'type_shop' => 0,
434
+                'mer_id' => 0,
435
+                'source' => 0,
436
+                'order_type' => 1,
437
+                'is_red_brokerage' => 0,
438
+                'gzc' => 3,
439
+                'take_time' => time(),
440
+                'district_id' => '',
441
+                'street_id' => '',
442
+                'month' => '',
443
+            ];
444
+            $a = Db::name('user_bill')->insert($bill);
69 445
 
446
+            $b = Db::name('user')->where('uid',$uid)->inc('brokerage_price',$money)->update();
447
+        }
70 448
     }
449
+
450
+    public function share_prosperity_test_group()
451
+    {
452
+        $groupUser = Db::name('shared_prosperity_group_user')->where('group_id',1)->select()->toArray();
453
+        $userData = array_column($groupUser,'user_id');
454
+        $money = 1.26;
455
+        foreach ($userData as $key => $uid) {
456
+            $bill = [
457
+                'uid' => $uid,
458
+                'link_id' => 0,
459
+                'pm' => 1,
460
+                'title' => '共富万人团分红',
461
+                'category' => 'now_money',
462
+                'type' => 'commission',
463
+                'number' => $money,
464
+                'balance' => 0,
465
+                'mark' => '共富万人团分红',
466
+                'create_time' => date('Y-m-d H:i:s'),
467
+                'status' => 1,
468
+                'commission_type' => CommonEnum::COMMISSION_TYPE['SHARED_PROSPERITY_GROUP_COMMISSION']['code'],
469
+                'order_sn' => 0,
470
+                'tripartite' => 0,
471
+                'type_shop' => 0,
472
+                'mer_id' => 0,
473
+                'source' => 0,
474
+                'order_type' => 1,
475
+                'is_red_brokerage' => 0,
476
+                'gzc' => 3,
477
+                'take_time' => time(),
478
+                'district_id' => '',
479
+                'street_id' => '',
480
+                'month' => '',
481
+            ];
482
+            $a = Db::name('user_bill')->insert($bill);
483
+
484
+            $b = Db::name('user')->where('uid',$uid)->inc('brokerage_price',$money)->update();
485
+        }
486
+
487
+    }
488
+
489
+    public function share_prosperity_test_partner()
490
+    {
491
+        $groupUser = Db::name('shared_prosperity_user')->where('partner_level',3)->select()->toArray();
492
+        $userData = array_column($groupUser,'user_id');
493
+        $money = 34.27;
494
+        foreach ($userData as $key => $uid) {
495
+            $bill = [
496
+                'uid' => $uid,
497
+                'link_id' => 0,
498
+                'pm' => 1,
499
+                'title' => '共富钻石合伙人分红',
500
+                'category' => 'now_money',
501
+                'type' => 'commission',
502
+                'number' => $money,
503
+                'balance' => 0,
504
+                'mark' => '共富钻石合伙人分红',
505
+                'create_time' => date('Y-m-d H:i:s'),
506
+                'status' => 1,
507
+                'commission_type' => CommonEnum::COMMISSION_TYPE['SHARED_PROSPERITY_PARTNER_COMMISSION']['code'],
508
+                'order_sn' => 0,
509
+                'tripartite' => 0,
510
+                'type_shop' => 0,
511
+                'mer_id' => 0,
512
+                'source' => 0,
513
+                'order_type' => 1,
514
+                'is_red_brokerage' => 0,
515
+                'gzc' => 3,
516
+                'take_time' => time(),
517
+                'district_id' => '',
518
+                'street_id' => '',
519
+                'month' => '',
520
+            ];
521
+            $a = Db::name('user_bill')->insert($bill);
522
+
523
+            $b = Db::name('user')->where('uid',$uid)->inc('brokerage_price',$money)->update();
524
+        }
525
+
526
+    }
527
+
71 528
 }

+ 4 - 0
app/controller/api/store/order/StoreRefundOrder.php

@@ -11,6 +11,7 @@
11 11
 namespace app\controller\api\store\order;
12 12
 
13 13
 
14
+use app\common\enum\CommonEnum;
14 15
 use crmeb\basic\BaseController;
15 16
 use app\common\repositories\store\order\StoreOrderProductRepository;
16 17
 use app\common\repositories\store\order\StoreOrderRepository;
@@ -137,6 +138,9 @@ class StoreRefundOrder extends BaseController
137 138
 
138 139
             $uid = $this->request->uid();
139 140
             $order = $orderRepository->userOrder($id, $uid);
141
+            if ($order['mer_id'] == CommonEnum::DESIGN_MERCHANT_ID['SharedProsperity']['code']) {
142
+                return app('json')->fail('共富区暂不支持退款');
143
+            }
140 144
             $store_order_product = Db::name('store_order_product')->where('order_id',$order['order_id'])->find();
141 145
             // 8会员300  10高级会员3000 14合伙人商品10000 15股权商品10000 16合伙人+股权商品2000
142 146
             if(in_array($store_order_product['type'],[8,9,10,11,12,13,14,15,16]))

+ 1 - 1
app/middleware/SecurityMiddleware.php

@@ -213,7 +213,7 @@ class SecurityMiddleware
213 213
 
214 214
             // 管道符后跟命令(避免匹配单纯的|字符)
215 215
             '/\|\s*(?:rm\s|cat\s|ls\s|wget\s|curl\s|nc\s|sh\s|bash\s)/i',
216
-            
216
+
217 217
             // 分号后跟命令(避免匹配HTML实体如 )
218 218
             '/;\s*(?:rm\s|cat\s|ls\s|wget\s|curl\s|nc\s|sh\s|bash\s|\$\w+)/i',
219 219
 

+ 6 - 0
route/api.php

@@ -1387,5 +1387,11 @@ Route::get('share_prosperity_thank', 'api.shareProsperity.Task/thankProfits');
1387 1387
 Route::get('share_prosperity_group', 'api.shareProsperity.Task/groupProfits');
1388 1388
 Route::get('share_prosperity_test', 'api.shareProsperity.Task/testProfits');
1389 1389
 
1390
+// 分红(万人团平均分)
1391
+Route::get('share_prosperity_test_group', 'api.shareProsperity.Task/share_prosperity_test_group');
1392
+// 分红(合伙人平均分)
1393
+Route::get('share_prosperity_test_partner', 'api.shareProsperity.Task/share_prosperity_test_partner');
1394
+
1395
+
1390 1396
 // 测试接口
1391 1397
 Route::get('/test', 'api.Test/test');