소스 검색

Merge branch 'dev' into dev-sc-260204

shichen 5 달 전
부모
커밋
7dba4f433e

+ 28 - 6
app/command/PensionTasks.php

@@ -3,16 +3,19 @@ declare (strict_types=1);
3 3
 
4 4
 namespace app\command;
5 5
 
6
+use app\common\enum\CommonEnum;
6 7
 use app\common\model\merchant\order\OrderMerchant;
7 8
 use app\common\model\store\order\StoreOrder;
8 9
 use app\common\model\user\User;
9 10
 use app\common\model\user\UserCertification;
10 11
 use app\common\repositories\merchant\order\OrderGzcRepository;
11 12
 use app\common\repositories\merchant\order\OrderMerchantRepository;
13
+use app\common\repositories\shared\SharedProsperityUserRepository;
12 14
 use app\common\repositories\store\order\StoreOrderStatusRepository;
13 15
 use app\common\repositories\store\product\ProductRepository;
14 16
 use app\common\repositories\user\UserBillRepository;
15 17
 use app\common\repositories\user\UserRepository;
18
+use app\entity\data\shared\SharedProsperityUserEntity;
16 19
 use app\traits\GzcApiRequest;
17 20
 use Carbon\Carbon;
18 21
 use think\console\Command;
@@ -1570,15 +1573,34 @@ class PensionTasks extends Command
1570 1573
     {
1571 1574
         // 普通订单
1572 1575
         $order_data = Db::name('store_order')->where('paid', 1)->where('is_settlement', 0)->where('pay_type', 'in', '0,1,2,4')->where([['status','in','2,3']])->select();
1573
-        $StoreOrderStatusRepository = app()->make(StoreOrderStatusRepository::class);
1574 1576
         if($order_data) {
1575 1577
             $order_data = $order_data->toArray();
1578
+            // foreach ($order_data as $online) {
1579
+            //     $date = date('Y-m-d H:i:s', strtotime('-' . $timeLimit . ' days'));
1580
+            //     if($date < $online['create_time']) continue;
1581
+            //     Db::transaction(function () use ($online) {
1582
+            //         $this->settleAward($online,0);
1583
+            //         Db::name('store_order')->where('order_id', $online['order_id'])->update(['is_settlement' => 1 ,'settlement_time' => date('Y-m-d H:i:s')]);
1584
+            //     });
1585
+            // }
1586
+            $orderIdList = [];
1587
+            $date = date('Y-m-d H:i:s', strtotime('-' . $timeLimit . ' days'));
1576 1588
             foreach ($order_data as $online) {
1577
-                $date = date('Y-m-d H:i:s', strtotime('-' . $timeLimit . ' days'));
1578
-                if($date < $online['create_time']) continue;
1579
-                Db::transaction(function () use ($online) {
1580
-                    $this->settleAward($online,0);
1581
-                    Db::name('store_order')->where('order_id', $online['order_id'])->update(['is_settlement' => 1 ,'settlement_time' => date('Y-m-d H:i:s')]);
1589
+                if (strtotime($online['create_time']) < strtotime($date)) {
1590
+                    $orderIdList[] = $online['order_id'];
1591
+                } else if ($order_data['mer_id'] == CommonEnum::DESIGN_MERCHANT_ID['SharedProsperity']['code']) {
1592
+                    if (strtotime($online['create_time']) < strtotime(date('Y-m-d 00:00:00'))) {
1593
+                        $orderIdList[] = $online['order_id'];
1594
+                    }
1595
+                }
1596
+            }
1597
+            if (!empty($orderIdList)) {
1598
+                Db::transaction(function () use ($orderIdList) {
1599
+                    // 系统订单 走新的 结算方法
1600
+                    /** @var StoreOrderRepository $storeOrderRepository */
1601
+                    $storeOrderRepository = app()->make(StoreOrderRepository::class);
1602
+                    $storeOrderRepository->settlementOrderByOrderIdList($orderIdList);
1603
+
1582 1604
                 });
1583 1605
             }
1584 1606
         }

+ 25 - 1
app/common/dao/shared/SharedProsperityRecommendConfigDao.php

@@ -15,7 +15,7 @@ class SharedProsperityRecommendConfigDao extends BaseDao
15 15
     }
16 16
 
17 17
     /**
18
-     * @return array
18
+     * @return SharedProsperityRecommendConfigEntity[]
19 19
      * @author 史晨
20 20
      * @date 2026/2/5 14:43
21 21
      * 获取推荐配置
@@ -81,4 +81,28 @@ class SharedProsperityRecommendConfigDao extends BaseDao
81 81
         }
82 82
         return $entityList;
83 83
     }
84
+
85
+    /**
86
+     * 获取 配置实体 根据 最大的 直推奖比例
87
+     * @return SharedProsperityRecommendConfigEntity
88
+     */
89
+    public function getSharedProsperityRecommendConfigEntityByMaxRewardRatio(): SharedProsperityRecommendConfigEntity
90
+    {
91
+        $entity = SharedProsperityRecommendConfigEntity::newInstance();
92
+        try {
93
+            /** @var SharedProsperityRecommendConfig $model */
94
+            $model = $this->getModel();
95
+            $dataRes = $model::getDB()
96
+                ->order('reward_ratio', 'desc')
97
+                ->limit(1)
98
+                ->select()
99
+                ->toArray();
100
+            if (!empty($dataRes)) {
101
+                $entity = SharedProsperityRecommendConfigEntity::newInstance($dataRes[0]);
102
+            }
103
+        } catch (\Exception $e) {
104
+
105
+        }
106
+        return $entity;
107
+    }
84 108
 }

+ 9 - 0
app/common/dao/store/order/StoreGroupOrderDao.php

@@ -18,6 +18,7 @@ use app\entity\CommonEntity;
18 18
 use app\entity\data\store\StoreGroupOrderEntity;
19 19
 use think\db\exception\DbException;
20 20
 use think\exception\ValidateException;
21
+use think\facade\Log;
21 22
 
22 23
 /**
23 24
  * Class StoreGroupOrderDao
@@ -165,6 +166,14 @@ class StoreGroupOrderDao extends BaseDao
165 166
                 ->where('group_order_id', '=', $storeGroupOrderEntity->getGroupOrderId())
166 167
                 ->update($storeGroupOrderEntity->toUnderlineArray());
167 168
         } catch (\Exception $e) {
169
+            Log::error('更新订单组支付成功状态失败' . json_encode([
170
+                    'error_message' => $e->getMessage(),
171
+                    'error_file' => $e->getFile(),
172
+                    'error_line' => $e->getLine(),
173
+                    'error_code' => $e->getCode(),
174
+                    'exception_class' => get_class($e),
175
+                    'trace' => $e->getTraceAsString()
176
+                ]));
168 177
             throw new ValidateException('更新订单组支付成功状态失败');
169 178
         }
170 179
         return $storeGroupOrderEntity;

+ 0 - 3
app/common/enum/CommonEnum.php

@@ -262,9 +262,6 @@ class CommonEnum
262 262
                 'YangLaoJin' => [
263 263
                     'Ratio' => ['code' => 0.05, 'name' => '将订单消费金额的5%,当做养老金分配给下单人']
264 264
                 ],
265
-                'Pv' => [
266
-                    'Ratio' => ['code' => 1, 'name' => '将利润的100%,作为PV值分配给下单人']
267
-                ],
268 265
                 'ConsumerStocks' => [
269 266
                     'Ratio' => ['code' => 0.5, 'name' => '在共富区消费者获得购买商品赠送商品额50%的消费股']
270 267
                 ],

+ 11 - 1
app/common/repositories/shared/SharedProsperityRecommendConfigRepository.php

@@ -38,7 +38,7 @@ class SharedProsperityRecommendConfigRepository extends BaseRepository
38 38
     }
39 39
 
40 40
     /**
41
-     * @return array
41
+     * @return SharedProsperityRecommendConfigEntity[]
42 42
      * @author 史晨
43 43
      * @date 2026/2/5 14:12
44 44
      */
@@ -98,4 +98,14 @@ class SharedProsperityRecommendConfigRepository extends BaseRepository
98 98
     {
99 99
         return $this->dao->getSharedProsperityRecommendConfigEntityListByLevelList($levelList);
100 100
     }
101
+
102
+
103
+    /**
104
+     * 获取 最大 推荐奖励占比
105
+     * @return SharedProsperityRecommendConfigEntity
106
+     */
107
+    public function getSharedProsperityRecommendConfigEntityByMaxRewardRatio(): SharedProsperityRecommendConfigEntity
108
+    {
109
+        return $this->getSharedProsperityRecommendConfigEntityByMaxRewardRatio();
110
+    }
101 111
 }

+ 36 - 0
app/common/repositories/shared/SharedProsperityUserRepository.php

@@ -5,6 +5,7 @@ namespace app\common\repositories\shared;
5 5
 use app\common\dao\shared\SharedProsperityUserDao;
6 6
 use app\common\dao\user\UserDao;
7 7
 use app\common\repositories\BaseRepository;
8
+use app\entity\data\shared\SharedProsperityRecommendConfigEntity;
8 9
 use app\entity\data\shared\SharedProsperityUserEntity;
9 10
 use think\db\exception\DbException;
10 11
 
@@ -254,4 +255,39 @@ class SharedProsperityUserRepository extends BaseRepository
254 255
     {
255 256
         return $this->dao->saveAll($dataList);
256 257
     }
258
+
259
+    /**
260
+     * 用户身份升级
261
+     * @param array $userIdList
262
+     * @return void
263
+     */
264
+    public function identityUpgrade(array $userIdList)
265
+    {
266
+        $sharedProsperityUserEntityList = $this->getSharedProsperityUserEntityListByUserIdList($userIdList);
267
+
268
+        /** @var SharedProsperityRecommendConfigRepository $sharedProsperityRecommendConfigRepository */
269
+        $sharedProsperityRecommendConfigRepository = app()->make(SharedProsperityRecommendConfigRepository::class);
270
+        $sharedProsperityRecommendConfigEntityList = $sharedProsperityRecommendConfigRepository->getList();
271
+        usort($sharedProsperityRecommendConfigEntityList, function (SharedProsperityRecommendConfigEntity $a, SharedProsperityRecommendConfigEntity $b) {
272
+            return $a->getPv() <=> $b->getPv();  // 从小到大排序
273
+        });
274
+        foreach ($sharedProsperityUserEntityList as $sharedProsperityUserEntity) {
275
+            $partnerLevel = 0;
276
+            foreach ($sharedProsperityRecommendConfigEntityList as $sharedProsperityRecommendConfigEntity) {
277
+                if ($sharedProsperityUserEntity->getPv() >= $sharedProsperityRecommendConfigEntity->getPv()) {
278
+                    $partnerLevel = $sharedProsperityRecommendConfigEntity->getLevel();
279
+                } else {
280
+                    // 如果本次验证的等级结果大于 之前的等级,说明用户升级了 需要更新等级
281
+                    if ($partnerLevel > $sharedProsperityUserEntity->getPartnerLevel()) {
282
+                        $this->updateByEntity(
283
+                            SharedProsperityUserEntity::newInstance()
284
+                                ->setId($sharedProsperityUserEntity->getId())
285
+                                ->setPartnerLevel($partnerLevel)
286
+                        );
287
+                    }
288
+                    break;
289
+                }
290
+            }
291
+        }
292
+    }
257 293
 }

+ 6 - 11
app/common/repositories/store/order/StoreGroupOrderRepository.php

@@ -178,7 +178,7 @@ class StoreGroupOrderRepository extends BaseRepository
178 178
         }
179 179
 
180 180
         // 3、逻辑处理
181
-        (new \think\facade\Db)->startTrans();
181
+        Db::startTrans();
182 182
         try {
183 183
             // 软 删除订单组
184 184
             $storeGroupOrderEntity->setIsDel(StoreGroupOrderEnum::IS_DEL['Yes']['code']);
@@ -189,9 +189,9 @@ class StoreGroupOrderRepository extends BaseRepository
189 189
                 $storeOrderRepository->closeStoreOrder($storeOrderEntity, $uid, $changeMessage, $remark);
190 190
             }
191 191
 
192
-            (new \think\facade\Db)->commit();
192
+            Db::commit();
193 193
         } catch (DbException $e) {
194
-            (new \think\facade\Db)->rollback();
194
+            Db::rollback();
195 195
         }
196 196
 
197 197
         // $groupOrder = $this->search(['paid' => 0, 'uid' => $uid ?: ''])->where('group_order_id', $id)->with(['orderList'])->find();
@@ -798,7 +798,7 @@ class StoreGroupOrderRepository extends BaseRepository
798 798
             ->setFzonePaytype($storeOrderCreateRequestEntity->getFzonePayType());
799 799
 
800 800
         // 4、写入数据
801
-        (new \think\facade\Db)->startTrans();
801
+        Db::startTrans();
802 802
         try {
803 803
             // 4.1 更细库存
804 804
             foreach ($productStockList as $item) {
@@ -878,9 +878,9 @@ class StoreGroupOrderRepository extends BaseRepository
878 878
                 $storeGroupOrderRepository->storeGroupOrderPaySuccess($storeGroupOrderEntity->getGroupOrderId());
879 879
             }
880 880
 
881
-            (new \think\facade\Db)->commit();
881
+            Db::commit();
882 882
         } catch (DbException $e) {
883
-            (new \think\facade\Db)->rollback();
883
+            Db::rollback();
884 884
             Log::error('StoreGroupOrderRepository-createStoreGroupOrder:' . $e->getMessage());
885 885
         }
886 886
         return ['order_id' => $storeGroupOrderEntity->getGroupOrderId(), 'groupOrder' => $storeGroupOrderEntity->toArray()];
@@ -948,11 +948,6 @@ class StoreGroupOrderRepository extends BaseRepository
948 948
         if (!empty($settlementOrderIdList)) {
949 949
             // 将订单 生成的奖励数据 立即结算(发放) 并更新这些订单的 结算字段以及结算时间
950 950
             $storeOrderRepository->settlementOrderByOrderIdList($settlementOrderIdList);
951
-
952
-            // 结算完成后更新用户的身份信息 设置用户 身份
953
-            /** @var UserRepository $userRepository */
954
-            $userRepository = app()->make(UserRepository::class);
955
-            $userRepository->setUserIdentity($storeGroupOrderEntity->getUid());
956 951
         }
957 952
 
958 953
         // 9、订单 分账 将收入的现金 商户部分 发放给 商户

+ 40 - 10
app/common/repositories/store/order/StoreOrderRepository.php

@@ -2867,12 +2867,13 @@ class StoreOrderRepository extends BaseRepository
2867 2867
                 Db::name("log")->insert(array('data' => '小程序支付回调5:' . json_encode($user)));//日志记录
2868 2868
                 Db::name("log")->insert(['data' => json_encode($order->mer_id)]);//日志记录
2869 2869
                 $merchant_type = Db::name('merchant')->where('mer_id', $order->mer_id)->value('merchant_type');
2870
-                if ($merchant_type == 2) {
2871
-                    $this->computed_yishangtong($order->order_sn);
2872
-                } else {
2873
-                    $this->computed($order, $user);
2874
-
2875
-                }
2870
+                // 这里暂时注释 -- 确认收货时不应修改 用户账单表 的 数据生效状态,应该是订单结算时,将奖励状态设置为 生效,目前这里将订单的 养老金、直推奖、锁客、分享佣金等设置为生效后,订单自动结算时,将导致未查询到待生效 奖励数据
2871
+                // if ($merchant_type == 2) {
2872
+                //     $this->computed_yishangtong($order->order_sn);
2873
+                // } else {
2874
+                //     $this->computed($order, $user);
2875
+                //
2876
+                // }
2876 2877
                 //分账
2877 2878
 //            $this -> splitOrder($order);
2878 2879
                 //TODO 确认收货
@@ -11615,7 +11616,13 @@ class StoreOrderRepository extends BaseRepository
11615 11616
             );
11616 11617
 
11617 11618
             // 发放共富区PV
11618
-            $pv = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['SharedProsperity']['Self']['Pv']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11619
+            /** @var SharedProsperityRecommendConfigRepository $sharedProsperityRecommendConfigRepository */
11620
+            $sharedProsperityRecommendConfigRepository = app()->make(SharedProsperityRecommendConfigRepository::class);
11621
+            $sharedProsperityRecommendConfigEntityByMaxRewardRatio = $sharedProsperityRecommendConfigRepository->getSharedProsperityRecommendConfigEntityByMaxRewardRatio();
11622
+            // 利润 减去 顶格的直推奖,剩下的是PV值
11623
+            $pvProportion = bcsub('1', bcdiv($sharedProsperityRecommendConfigEntityByMaxRewardRatio->getRewardRatio(), '100', 4), 2);
11624
+
11625
+            $pv = bcmul($storeOrderEntity->getConPri(), $pvProportion, CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11619 11626
             /** @var SharedProsperityRewardRecordRepository $sharedProsperityRewardRecordRepository */
11620 11627
             $sharedProsperityRewardRecordRepository = app()->make(SharedProsperityRewardRecordRepository::class);
11621 11628
             $sharedProsperityRewardRecordRepository->addSharedProsperityRewardRecord(
@@ -11676,7 +11683,7 @@ class StoreOrderRepository extends BaseRepository
11676 11683
                         $userBillRepository = app()->make(UserBillRepository::class);
11677 11684
                         $userBillRepository->addUserBill(
11678 11685
                             $sharedProsperityUserEntityByParent->getUserId(),
11679
-                            UserBillEnum::COMMISSION_TYPE['DIRECT_REFERRAL']['code'],
11686
+                            UserBillEnum::COMMISSION_TYPE['SHARED_PROSPERITY_DIRECT_COMMISSION']['code'],
11680 11687
                             UserBillEnum::PM['INCOME']['code'],
11681 11688
                             $brokeragePriceBySpreadUid,
11682 11689
                             UserBillEnum::CATEGORY['NowMoney']['code'],
@@ -11998,10 +12005,22 @@ class StoreOrderRepository extends BaseRepository
11998 12005
                 $userSignGongxianRepository = app()->make(UserSignGongxianRepository::class);
11999 12006
                 $userSignGongxianEntityList = $userSignGongxianRepository->getUserSignGongxianEntityListByOrderIdListAndPending(UserSignGongxianEnum::ORDER_TYPE['Platform']['code'], $unsettledOrderIdList);
12000 12007
                 if (!empty($userSignGongxianEntityList)) {
12001
-                    $userSignGongxianIdList = array_map(function ($userSignGongxianEntity) {
12008
+                    $affectedUserIdListByMember = [];
12009
+                    $userSignGongxianIdList = array_map(function ($userSignGongxianEntity) use (&$affectedUserIdListByMember) {
12010
+                        $affectedUserIdListByMember[] = $userSignGongxianEntity->getUid();
12002 12011
                         return $userSignGongxianEntity->getId();
12003 12012
                     }, $userSignGongxianEntityList);
12004 12013
                     $userSignGongxianRepository->executeByIdList($userSignGongxianIdList);
12014
+                    // 会员体系结构 依靠贡献值变化而升级,所以当贡献值产生变化时 需记录用户ID 进行升级
12015
+                    if (!empty($affectedUserIdListByMember)) {
12016
+                        $affectedUserIdListByMember = array_unique($affectedUserIdListByMember);
12017
+                        // 结算完成后更新用户的身份信息 设置用户 身份
12018
+                        /** @var UserRepository $userRepository */
12019
+                        $userRepository = app()->make(UserRepository::class);
12020
+                        foreach ($affectedUserIdListByMember as $userId) {
12021
+                            $userRepository->setUserIdentity($userId);
12022
+                        }
12023
+                    }
12005 12024
                 }
12006 12025
 
12007 12026
                 /** 结算 PV */
@@ -12031,10 +12050,21 @@ class StoreOrderRepository extends BaseRepository
12031 12050
                 $sharedProsperityRewardRecordRepository = app()->make(SharedProsperityRewardRecordRepository::class);
12032 12051
                 $sharedProsperityRewardRecordEntityList = $sharedProsperityRewardRecordRepository->getSharedProsperityRewardRecordEntityListByOrderSnListAndPending(SharedProsperityRewardRecordEnum::TYPE_SHOP['Platform']['code'], $unsettledOrderSnList);
12033 12052
                 if (!empty($sharedProsperityRewardRecordEntityList)) {
12034
-                    $sharedProsperityRewardRecordIdList = array_map(function ($sharedProsperityRewardRecordEntity) {
12053
+                    $affectedUserIdListBySharedProsperity = [];
12054
+                    $sharedProsperityRewardRecordIdList = array_map(function ($sharedProsperityRewardRecordEntity) use (&$affectedUserIdListBySharedProsperity) {
12055
+                        if ($sharedProsperityRewardRecordEntity->getType() == SharedProsperityRewardRecordEnum::TYPE['PV']['code']) {
12056
+                            $affectedUserIdListBySharedProsperity[] = $sharedProsperityRewardRecordEntity->getUserId();
12057
+                        }
12035 12058
                         return $sharedProsperityRewardRecordEntity->getId();
12036 12059
                     }, $sharedProsperityRewardRecordEntityList);
12037 12060
                     $sharedProsperityRewardRecordRepository->executeByIdList($sharedProsperityRewardRecordIdList);
12061
+                    // 当用户PV产生变化时,需要更新产生变化用户的 共富体系等级
12062
+                    if (!empty($affectedUserIdListBySharedProsperity)) {
12063
+                        $affectedUserIdListBySharedProsperity = array_unique($affectedUserIdListBySharedProsperity);
12064
+                        /** @var SharedProsperityUserRepository $sharedProsperityUserRepository */
12065
+                        $sharedProsperityUserRepository = app()->make(SharedProsperityUserRepository::class);
12066
+                        $sharedProsperityUserRepository->identityUpgrade($affectedUserIdListBySharedProsperity);
12067
+                    }
12038 12068
                 }
12039 12069
 
12040 12070
                 // 订单奖励结算时 更新订单自身 结算字段

+ 7 - 7
app/controller/api/store/order/StoreOrder.php

@@ -109,13 +109,13 @@ class StoreOrder extends BaseController
109 109
     public function createOrder(StoreCartRepository $cartRepository)
110 110
     {
111 111
         $uid = $this->request->uid();
112
-        if (in_array($uid, [1592, 766, 6, 783, 7, 1166])) {
113
-            $request = new Request();
114
-            $storeOrderCreateValidate = new StoreOrderCreateValidate($request);
115
-            /** @var StoreGroupOrder $storeGroupOrderController */
116
-            $storeGroupOrderController = app()->make(StoreGroupOrder::class);
117
-            return $storeGroupOrderController->createStoreGroupOrder($storeOrderCreateValidate);
118
-        }
112
+        // if (in_array($uid, [1592, 766, 6, 783, 7, 1166])) {
113
+        //     $request = new Request();
114
+        //     $storeOrderCreateValidate = new StoreOrderCreateValidate($request);
115
+        //     /** @var StoreGroupOrder $storeGroupOrderController */
116
+        //     $storeGroupOrderController = app()->make(StoreGroupOrder::class);
117
+        //     return $storeGroupOrderController->createStoreGroupOrder($storeOrderCreateValidate);
118
+        // }
119 119
 
120 120
         $cartId = (array)$this->request->param('cart_id', []);
121 121
 

+ 19 - 0
app/entity/data/shared/SharedProsperityUserEntity.php

@@ -11,6 +11,7 @@ class SharedProsperityUserEntity extends DataEntity
11 11
     public $parentId = null;  // 推荐人用户id
12 12
     public $pv = null;  // pv
13 13
     public $consumerStocks = null; // 消费股
14
+    public $balance = null; // 余额
14 15
     public $withdrawalLimit = null;  // 提现额度
15 16
     public $partnerLevel = null;  // 合伙人等级
16 17
     public $points = null;
@@ -110,6 +111,24 @@ class SharedProsperityUserEntity extends DataEntity
110 111
     /**
111 112
      * @return mixed
112 113
      */
114
+    public function getBalance()
115
+    {
116
+        return $this->balance;
117
+    }
118
+
119
+    /**
120
+     * @param mixed $balance
121
+     * @return SharedProsperityUserEntity
122
+     */
123
+    public function setBalance($balance): SharedProsperityUserEntity
124
+    {
125
+        $this->balance = $balance;
126
+        return $this;
127
+    }
128
+
129
+    /**
130
+     * @return mixed
131
+     */
113 132
     public function getWithdrawalLimit()
114 133
     {
115 134
         return $this->withdrawalLimit;

+ 18 - 18
app/entity/data/store/StoreGroupOrderEntity.php

@@ -28,7 +28,7 @@ class StoreGroupOrderEntity extends DataEntity
28 28
     public $isDel = null;  // 是否删除
29 29
     public $rand = null;  // 订单号随机数
30 30
     public $split = null;  // 分账状态
31
-    public $serialNumber = null;  // 首信易交易流水号
31
+    // public $serialNumber = null;  // 首信易交易流水号
32 32
     public $testOrder = null;  // 测试订单
33 33
     public $hfPayId = null;  // 汇付订单id
34 34
     public $payWx = null;  // 微信支付渠道后台设置
@@ -430,23 +430,23 @@ class StoreGroupOrderEntity extends DataEntity
430 430
         return $this;
431 431
     }
432 432
 
433
-    /**
434
-     * @return mixed
435
-     */
436
-    public function getSerialNumber()
437
-    {
438
-        return $this->serialNumber;
439
-    }
440
-
441
-    /**
442
-     * @param mixed $serialNumber
443
-     * @return StoreGroupOrderEntity
444
-     */
445
-    public function setSerialNumber($serialNumber): StoreGroupOrderEntity
446
-    {
447
-        $this->serialNumber = $serialNumber;
448
-        return $this;
449
-    }
433
+    // /**
434
+    //  * @return mixed
435
+    //  */
436
+    // public function getSerialNumber()
437
+    // {
438
+    //     return $this->serialNumber;
439
+    // }
440
+    //
441
+    // /**
442
+    //  * @param mixed $serialNumber
443
+    //  * @return StoreGroupOrderEntity
444
+    //  */
445
+    // public function setSerialNumber($serialNumber): StoreGroupOrderEntity
446
+    // {
447
+    //     $this->serialNumber = $serialNumber;
448
+    //     return $this;
449
+    // }
450 450
 
451 451
     /**
452 452
      * @return mixed

+ 7 - 10
app/entity/data/store/StoreOrderEntity.php

@@ -1608,18 +1608,15 @@ class StoreOrderEntity extends DataEntity
1608 1608
      */
1609 1609
     public function setFzonePaytype($fzonePaytype): StoreOrderEntity
1610 1610
     {
1611
-        if (!is_string($fzonePaytype)) {
1612
-            $fzonePaytypePre = $fzonePaytype;
1613
-            $fzonePaytype = '';
1614
-
1615
-            if (is_array($fzonePaytypePre)) {
1616
-                $fzonePaytype = json_encode($fzonePaytypePre);
1611
+        if (is_array($fzonePaytype)) {
1612
+            $this->fzonePaytype = json_encode($fzonePaytype);
1613
+            $this->deconstructionFzonePaytype();
1614
+        } else if (is_string($fzonePaytype)) {
1615
+            if (!empty(json_decode($fzonePaytype, true))) {
1616
+                $this->fzonePaytype = $fzonePaytype;
1617
+                $this->deconstructionFzonePaytype();
1617 1618
             }
1618
-
1619
-            unset($fzonePaytypePre);
1620 1619
         }
1621
-        $this->fzonePaytype = $fzonePaytype;
1622
-        $this->deconstructionFzonePaytype();
1623 1620
         return $this;
1624 1621
     }
1625 1622
 

+ 1 - 1
route/api.php

@@ -129,7 +129,7 @@ Route::group('api/', function () {
129 129
         })->prefix('api.store.order.StoreOrder');
130 130
 
131 131
         //订单
132
-        Route::group('order', function () {
132
+        Route::group('store_group_order', function () {
133 133
             Route::post('create', '/createStoreGroupOrder');//创建订单
134 134
         })->prefix('api.store.order.StoreGroupOrder');
135 135