Просмотр исходного кода

优化用户下单方法-进行中

sunxbiao 1 год назад
Родитель
Сommit
ca61f9af6c

+ 11 - 8
app/common/dao/store/order/StoreOrderDao.php

@@ -607,24 +607,27 @@ class StoreOrderDao extends BaseDao
607
     }
607
     }
608
 
608
 
609
     /**
609
     /**
610
-     * @param $orderId
611
-     * @return CommonEntity
610
+     * @param array $orderIdList
611
+     * @return CommonEntity[]
612
      */
612
      */
613
-    public function getStoreOrderEntityByOrderId($orderId): CommonEntity
613
+    public function getStoreOrderEntityListByOrderIdList(array $orderIdList): array
614
     {
614
     {
615
-        $data = [];
615
+        $entityList = [];
616
         try {
616
         try {
617
             /** @var StoreOrder $model */
617
             /** @var StoreOrder $model */
618
             $model = $this->getModel();
618
             $model = $this->getModel();
619
             $dataRes = $model::getDB()
619
             $dataRes = $model::getDB()
620
-                ->where('order_id', '=', $orderId)
621
-                ->find();
620
+                ->whereIn('order_id', $orderIdList)
621
+                ->select()
622
+                ->toArray();
622
             if (!empty($dataRes)) {
623
             if (!empty($dataRes)) {
623
-                $data = $dataRes->toArray();
624
+                $entityList = array_map(function ($data) {
625
+                    return StoreOrderEntity::newInstance($data);
626
+                }, $dataRes);
624
             }
627
             }
625
         } catch (\Exception $e) {
628
         } catch (\Exception $e) {
626
 
629
 
627
         }
630
         }
628
-        return StoreOrderEntity::newInstance($data);
631
+        return $entityList;
629
     }
632
     }
630
 }
633
 }

+ 45 - 0
app/common/dao/system/merchant/MerchantContributionDao.php

@@ -0,0 +1,45 @@
1
+<?php
2
+
3
+namespace app\common\dao\system\merchant;
4
+
5
+
6
+use app\common\dao\BaseDao;
7
+use app\common\model\system\merchant\MerchantContribution;
8
+use app\entity\CommonEntity;
9
+use app\entity\data\merchant\MerchantContributionEntity;
10
+
11
+
12
+class MerchantContributionDao extends BaseDao
13
+{
14
+
15
+    protected function getModel(): string
16
+    {
17
+        return MerchantContribution::class;
18
+    }
19
+
20
+    /**
21
+     * 根据商家的让利比例 获取对应的 配置信息
22
+     * @param float $profitSharing
23
+     * @return CommonEntity
24
+     */
25
+    public function getMerchantContributionEntityByProfitSharing(float $profitSharing): CommonEntity
26
+    {
27
+        $data = [];
28
+        try {
29
+            /** @var MerchantContribution $model */
30
+            $model = $this->getModel();
31
+            $dataRes = $model::getDB()->select()->toArray();
32
+            if (!empty($dataRes)) {
33
+                foreach ($dataRes as $item) {
34
+                    if ($item['start'] <= $profitSharing && $item['end'] >= $profitSharing) {
35
+                        $data = $item;
36
+                        break;
37
+                    }
38
+                }
39
+            }
40
+        } catch (\Exception $e) {
41
+
42
+        }
43
+        return MerchantContributionEntity::newInstance($data);
44
+    }
45
+}

+ 30 - 0
app/common/dao/user/UserBillDao.php

@@ -12,10 +12,14 @@ namespace app\common\dao\user;
12
 
12
 
13
 
13
 
14
 use app\common\dao\BaseDao;
14
 use app\common\dao\BaseDao;
15
+use app\common\enum\user\UserBillEnum;
15
 use app\common\model\BaseModel;
16
 use app\common\model\BaseModel;
16
 use app\common\model\user\UserBill;
17
 use app\common\model\user\UserBill;
17
 use app\entity\CommonEntity;
18
 use app\entity\CommonEntity;
18
 use app\entity\data\user\UserBillEntity;
19
 use app\entity\data\user\UserBillEntity;
20
+use think\db\exception\DataNotFoundException;
21
+use think\db\exception\DbException;
22
+use think\db\exception\ModelNotFoundException;
19
 
23
 
20
 /**
24
 /**
21
  * Class UserBillDao
25
  * Class UserBillDao
@@ -206,4 +210,30 @@ class UserBillDao extends BaseDao
206
         }
210
         }
207
         return UserBillEntity::newInstance($data);
211
         return UserBillEntity::newInstance($data);
208
     }
212
     }
213
+
214
+    /**
215
+     * @param string $typeShop
216
+     * @param array $orderIdList
217
+     * @return UserBillEntity[]
218
+     */
219
+    public function getUserBillEntityListByOrderIdListAndPending(string $typeShop, array $orderIdList): array
220
+    {
221
+        $entityList = [];
222
+        try {
223
+            $dataList = UserBill::getDB()
224
+                ->where('type_shop', '=', $typeShop)
225
+                ->whereIn('order_id', $orderIdList)
226
+                ->where('status', '=', UserBillEnum::STATUS['PENDING']['code'])
227
+                ->select()
228
+                ->toArray();
229
+            if (!empty($dataList)) {
230
+                $entityList = array_map(function ($data) {
231
+                    return UserBillEntity::newInstance($data);
232
+                }, $dataList);
233
+            }
234
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $e) {
235
+
236
+        }
237
+        return $entityList;
238
+    }
209
 }
239
 }

+ 14 - 0
app/common/dao/user/UserSignFenrunDao.php

@@ -0,0 +1,14 @@
1
+<?php
2
+
3
+namespace app\common\dao\user;
4
+
5
+use app\common\dao\BaseDao;
6
+use app\common\model\user\UserSignFenrun;
7
+
8
+class UserSignFenrunDao extends BaseDao
9
+{
10
+    protected function getModel(): string
11
+    {
12
+        return UserSignFenrun::class;
13
+    }
14
+}

+ 2 - 8
app/common/enum/CommonEnum.php

@@ -56,6 +56,8 @@ class CommonEnum
56
     const CALCULATE_THE_NUMBER_OF_DECIMAL_PLACES = 5;
56
     const CALCULATE_THE_NUMBER_OF_DECIMAL_PLACES = 5;
57
     // 金额保留小数点位 超出部分舍弃
57
     // 金额保留小数点位 超出部分舍弃
58
     const DECIMAL_PLACES_OF_THE_AMOUNT = 2;
58
     const DECIMAL_PLACES_OF_THE_AMOUNT = 2;
59
+    // 平台手续费(汇付通道服务费)
60
+    const HUIFU_COMMISSION_CHARGE = 0.0038;
59
 
61
 
60
     // 订单 收益 的分配
62
     // 订单 收益 的分配
61
     const ORDER_EARNING_ALLOCATION = [
63
     const ORDER_EARNING_ALLOCATION = [
@@ -220,14 +222,6 @@ class CommonEnum
220
                     'Ratio' => ['code' => 0.35 * 0.5, 'name' => '将利润的35%中的5%,当做养老金分配给推荐人']
222
                     'Ratio' => ['code' => 0.35 * 0.5, 'name' => '将利润的35%中的5%,当做养老金分配给推荐人']
221
                 ]
223
                 ]
222
             ],
224
             ],
223
-            'Share' => [
224
-                'BrokeragePrice' => [
225
-                    'Ratio' => ['code' => 0.35 * 0.03 * 0.9, 'name' => '将利润的 35% 中的 3% 中的 90%,做为分享奖励的佣金部分'],
226
-                ],
227
-                'Fugou' => [
228
-                    'Ratio' => ['code' => 0.35 * 0.03 * 0.1, 'name' => '将利润的 35% 中的 3% 中的 10%,做为分享奖励的复购部分'],
229
-                ]
230
-            ],
231
             'Lock' => [
225
             'Lock' => [
232
                 'BrokeragePrice' => [
226
                 'BrokeragePrice' => [
233
                     'Ratio' => ['code' => 0.35 * 0.05 * 0.9, 'name' => '将利润的 35% 中的 5% 中的 90%,做为锁客奖励的佣金部分'],
227
                     'Ratio' => ['code' => 0.35 * 0.05 * 0.9, 'name' => '将利润的 35% 中的 5% 中的 90%,做为锁客奖励的佣金部分'],

+ 18 - 0
app/common/enum/user/UserSignFenrunEnum.php

@@ -0,0 +1,18 @@
1
+<?php
2
+
3
+namespace app\common\enum\user;
4
+
5
+use app\common\enum\CommonEnum;
6
+
7
+class UserSignFenrunEnum extends CommonEnum
8
+{
9
+    // 状态枚举
10
+    const STATUS = [
11
+        'Settled' => ['code' => 1, 'name' => '已结算'],
12
+        'Invalid' => ['code' => 0, 'name' => '已失效'],
13
+        'Unsettled' => ['code' => -1, 'name' => '未结算'],
14
+    ];
15
+
16
+    // 订单类型枚举
17
+    const ORDER_TYPE = parent::ORDER_TYPE;
18
+}

+ 2 - 0
app/common/enum/user/UserSignJingdouEnum.php

@@ -18,4 +18,6 @@ class UserSignJingdouEnum extends CommonEnum
18
         'Gift' => ['code' => 1, 'name' => '赠送'],
18
         'Gift' => ['code' => 1, 'name' => '赠送'],
19
         'Consume' => ['code' => 2, 'name' => '消耗'],
19
         'Consume' => ['code' => 2, 'name' => '消耗'],
20
     ];
20
     ];
21
+
22
+    const ORDER_TYPE = parent::ORDER_TYPE;
21
 }
23
 }

+ 20 - 0
app/common/model/system/merchant/MerchantContribution.php

@@ -0,0 +1,20 @@
1
+<?php
2
+
3
+namespace app\common\model\system\merchant;
4
+
5
+
6
+use app\common\model\BaseModel;
7
+
8
+class MerchantContribution extends BaseModel
9
+{
10
+
11
+    public static function tablePk(): string
12
+    {
13
+        return 'id';
14
+    }
15
+
16
+    public static function tableName(): string
17
+    {
18
+        return 'merchant_contribution';
19
+    }
20
+}

+ 19 - 0
app/common/model/user/UserSignFenrun.php

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace app\common\model\user;
4
+
5
+use app\common\model\BaseModel;
6
+
7
+class UserSignFenrun extends BaseModel
8
+{
9
+
10
+    public static function tablePk(): string
11
+    {
12
+        return 'id';
13
+    }
14
+
15
+    public static function tableName(): string
16
+    {
17
+        return 'user_sign_fenrun';
18
+    }
19
+}

+ 171 - 16
app/common/repositories/store/order/StoreOrderRepository.php

@@ -22,6 +22,7 @@ use app\common\enum\store\StoreOrderEnum;
22
 use app\common\enum\user\UserBillEnum;
22
 use app\common\enum\user\UserBillEnum;
23
 use app\common\enum\user\UserEnum;
23
 use app\common\enum\user\UserEnum;
24
 use app\common\enum\user\UserPvLogEnum;
24
 use app\common\enum\user\UserPvLogEnum;
25
+use app\common\enum\user\UserSignFenrunEnum;
25
 use app\common\enum\user\UserSignFugouEnum;
26
 use app\common\enum\user\UserSignFugouEnum;
26
 use app\common\enum\user\UserSignGongxianEnum;
27
 use app\common\enum\user\UserSignGongxianEnum;
27
 use app\common\enum\user\UserSignHongbaoEnum;
28
 use app\common\enum\user\UserSignHongbaoEnum;
@@ -52,15 +53,19 @@ use app\common\repositories\store\shipping\ShippingTemplateUndeliveRepository;
52
 use app\common\repositories\store\StoreSeckillActiveRepository;
53
 use app\common\repositories\store\StoreSeckillActiveRepository;
53
 use app\common\repositories\system\attachment\AttachmentRepository;
54
 use app\common\repositories\system\attachment\AttachmentRepository;
54
 use app\common\repositories\system\merchant\FinancialRecordRepository;
55
 use app\common\repositories\system\merchant\FinancialRecordRepository;
56
+use app\common\repositories\system\merchant\MerchantCategoryRepository;
57
+use app\common\repositories\system\merchant\MerchantContributionRepository;
55
 use app\common\repositories\system\merchant\MerchantRepository;
58
 use app\common\repositories\system\merchant\MerchantRepository;
56
 use app\common\repositories\merchant\MerchantRepository as m;
59
 use app\common\repositories\merchant\MerchantRepository as m;
57
 use app\common\repositories\user\UserAddressRepository;
60
 use app\common\repositories\user\UserAddressRepository;
58
 use app\common\repositories\user\UserBillRepository;
61
 use app\common\repositories\user\UserBillRepository;
59
 use app\common\repositories\user\UserPvLogRepository;
62
 use app\common\repositories\user\UserPvLogRepository;
60
 use app\common\repositories\user\UserRepository;
63
 use app\common\repositories\user\UserRepository;
64
+use app\common\repositories\user\UserSignFenrunRepository;
61
 use app\common\repositories\user\UserSignFugouRepository;
65
 use app\common\repositories\user\UserSignFugouRepository;
62
 use app\common\repositories\user\UserSignGongxianRepository;
66
 use app\common\repositories\user\UserSignGongxianRepository;
63
 use app\common\repositories\user\UserSignHongbaoRepository;
67
 use app\common\repositories\user\UserSignHongbaoRepository;
68
+use app\common\repositories\user\UserSignJingdouRepository;
64
 use app\common\repositories\user\UserSignScoreRepository;
69
 use app\common\repositories\user\UserSignScoreRepository;
65
 use app\common\repositories\user\UserThirdRepository;
70
 use app\common\repositories\user\UserThirdRepository;
66
 use app\common\repositories\wechat\RoutineQrcodeRepository;
71
 use app\common\repositories\wechat\RoutineQrcodeRepository;
@@ -10991,7 +10996,10 @@ class StoreOrderRepository extends BaseRepository
10991
             // 创建订单
10996
             // 创建订单
10992
             /** @var StoreOrderEntity $storeOrderEntity */
10997
             /** @var StoreOrderEntity $storeOrderEntity */
10993
             $storeOrderEntity = StoreOrderEntity::newInstance();
10998
             $storeOrderEntity = StoreOrderEntity::newInstance();
10994
-            $storeOrderEntity->setCommissionRate((float)$merchantRepository->get($cartEntity->getMerId())->mer_commission_rate)
10999
+            // $huifuCommissionRate = CommonEnum::HUIFU_COMMISSION_CHARGE;
11000
+            // ->setCommissionRate(现金 * $huifuCommissionRate)
11001
+            $storeOrderEntity
11002
+                ->setExtensionOne($productAttrValueEntity->getExtensionOne())
10995
                 // 二级佣金 此字段已被用于分佣比例
11003
                 // 二级佣金 此字段已被用于分佣比例
10996
                 ->setExtensionTwo($productAttrValueEntity->getExtensionTwo())
11004
                 ->setExtensionTwo($productAttrValueEntity->getExtensionTwo())
10997
                 ->setOrderSn($this->getNewOrderId() . ($num++))
11005
                 ->setOrderSn($this->getNewOrderId() . ($num++))
@@ -11057,6 +11065,9 @@ class StoreOrderRepository extends BaseRepository
11057
             $storeOrderEntityList[$key] = $storeOrderEntity;
11065
             $storeOrderEntityList[$key] = $storeOrderEntity;
11058
             $storeOrderIdList[] = $storeOrderEntity->getOrderId();
11066
             $storeOrderIdList[] = $storeOrderEntity->getOrderId();
11059
 
11067
 
11068
+            // 生成奖励数据
11069
+            $this->createRewardMechanismByStoreOrderId($storeOrderEntity->getOrderId());
11070
+
11060
             // 将每件商品设计到的优惠券要取消掉
11071
             // 将每件商品设计到的优惠券要取消掉
11061
 
11072
 
11062
             // 准备订单的 状态数据
11073
             // 准备订单的 状态数据
@@ -11245,8 +11256,6 @@ class StoreOrderRepository extends BaseRepository
11245
                 'status' => StoreOrderEnum::STATUS['WAITING_SHIPMENT']['code'],
11256
                 'status' => StoreOrderEnum::STATUS['WAITING_SHIPMENT']['code'],
11246
                 'distribution_mode' => StoreOrderEnum::DISTRIBUTION_MODE['ExpressDelivery']
11257
                 'distribution_mode' => StoreOrderEnum::DISTRIBUTION_MODE['ExpressDelivery']
11247
             ]);
11258
             ]);
11248
-
11249
-
11250
             foreach ($storeOrderEntityList as $storeOrderEntity) {
11259
             foreach ($storeOrderEntityList as $storeOrderEntity) {
11251
 
11260
 
11252
             }
11261
             }
@@ -11261,12 +11270,31 @@ class StoreOrderRepository extends BaseRepository
11261
      */
11270
      */
11262
     public function getStoreOrderEntityByOrderId(int $orderId): StoreOrderEntity
11271
     public function getStoreOrderEntityByOrderId(int $orderId): StoreOrderEntity
11263
     {
11272
     {
11264
-        /** @var StoreOrderEntity $storeOrderEntity */
11265
-        $storeOrderEntity = $this->dao->getStoreOrderEntityByOrderId($orderId);
11266
-        return $storeOrderEntity;
11273
+        $entityList = $this->getStoreOrderEntityListByOrderIdList([$orderId]);
11274
+        $entity = array_shift($entityList);
11275
+        if ($entity instanceof StoreOrderEntity) {
11276
+            return $entity;
11277
+        } else {
11278
+            /** @var StoreOrderEntity */
11279
+            return StoreOrderEntity::newInstance();
11280
+        }
11281
+    }
11282
+
11283
+    /**
11284
+     * @param array $orderIdList
11285
+     * @return StoreOrderEntity[]
11286
+     */
11287
+    public function getStoreOrderEntityListByOrderIdList(array $orderIdList): array
11288
+    {
11289
+        return $this->dao->getStoreOrderEntityListByOrderIdList($orderIdList);
11267
     }
11290
     }
11268
 
11291
 
11269
-    public function createCommissionByStoreOrderEntity(int $orderId)
11292
+    /**
11293
+     * 根据 订单ID 来生 成奖励数据(待生效)
11294
+     * @param int $orderId
11295
+     * @return void
11296
+     */
11297
+    public function createRewardMechanismByStoreOrderId(int $orderId)
11270
     {
11298
     {
11271
         /** @var StoreOrderRepository $storeOrderRepository */
11299
         /** @var StoreOrderRepository $storeOrderRepository */
11272
         $storeOrderRepository = app()->make(StoreOrderRepository::class);
11300
         $storeOrderRepository = app()->make(StoreOrderRepository::class);
@@ -11698,6 +11726,10 @@ class StoreOrderRepository extends BaseRepository
11698
                 }
11726
                 }
11699
             }
11727
             }
11700
         } else {
11728
         } else {
11729
+            /** @var MerchantRepository $merchantRepository */
11730
+            $merchantRepository = app()->make(MerchantRepository::class);
11731
+            $merchantEntity = $merchantRepository->getMerchantEntityByMerchantId($storeOrderEntity->getMerId());
11732
+
11701
             // 为消费者 初始化 添加养老金记录
11733
             // 为消费者 初始化 添加养老金记录
11702
             $yanglaojin = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['CommercialDistrict']['Self']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11734
             $yanglaojin = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['CommercialDistrict']['Self']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11703
             /** @var UserBillRepository $userBillRepository */
11735
             /** @var UserBillRepository $userBillRepository */
@@ -11750,7 +11782,18 @@ class StoreOrderRepository extends BaseRepository
11750
                 $storeOrderEntity->getOrderId()
11782
                 $storeOrderEntity->getOrderId()
11751
             );
11783
             );
11752
 
11784
 
11753
-            // 分润记录 todo
11785
+            // 分润记录
11786
+            if (!empty($merchantEntity->getUid())) {
11787
+                /** @var UserSignFenrunRepository $userSignFenrunRepository */
11788
+                $userSignFenrunRepository = app()->make(UserSignFenrunRepository::class);
11789
+                $userSignFenrunRepository->addUserSingFenrun(
11790
+                    $merchantEntity->getUid(),
11791
+                    $storeOrderEntity->getConPri(),
11792
+                    '商贸区下单产生分润值',
11793
+                    UserSignFenrunEnum::ORDER_TYPE['Platform']['code'],
11794
+                    $storeOrderEntity->getOrderId()
11795
+                );
11796
+            }
11754
 
11797
 
11755
             // 给老用户的奖励 红包
11798
             // 给老用户的奖励 红包
11756
             if ($userEntity->getIsOld()) {
11799
             if ($userEntity->getIsOld()) {
@@ -11850,19 +11893,19 @@ class StoreOrderRepository extends BaseRepository
11850
                 }
11893
                 }
11851
             }
11894
             }
11852
 
11895
 
11853
-            // 锁客收益 todo
11896
+            // 锁客收益
11854
             if (!empty($userEntity->getMerId())) {
11897
             if (!empty($userEntity->getMerId())) {
11855
                 /** @var MerchantRepository $merchantRepository */
11898
                 /** @var MerchantRepository $merchantRepository */
11856
                 $merchantRepository = app()->make(MerchantRepository::class);
11899
                 $merchantRepository = app()->make(MerchantRepository::class);
11857
-                $merchantEntity = $merchantRepository->getMerchantEntityByMerchantId($userEntity->getMerId());
11858
-                if ($merchantEntity->getStatus() == MerchantEnum::STATUS['Normal']['code'] && !empty($merchantEntity->getUid())) {
11900
+                $merchantEntityByLock = $merchantRepository->getMerchantEntityByMerchantId($userEntity->getMerId());
11901
+                if ($merchantEntityByLock->getStatus() == MerchantEnum::STATUS['Normal']['code'] && !empty($merchantEntityByLock->getUid())) {
11859
                     // 计算 佣金
11902
                     // 计算 佣金
11860
-                    $brokeragePriceByMerId = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Lock']['BrokeragePrice']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11903
+                    $brokeragePriceByMerId = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['CommercialDistrict']['Lock']['BrokeragePrice']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11861
                     // 添加佣金记录
11904
                     // 添加佣金记录
11862
                     /** @var UserBillRepository $userBillRepository */
11905
                     /** @var UserBillRepository $userBillRepository */
11863
                     $userBillRepository = app()->make(UserBillRepository::class);
11906
                     $userBillRepository = app()->make(UserBillRepository::class);
11864
                     $userBillRepository->addUserBill(
11907
                     $userBillRepository->addUserBill(
11865
-                        $merchantEntity->getUid(),
11908
+                        $merchantEntityByLock->getUid(),
11866
                         UserBillEnum::TYPE_SHOP['Platform']['code'],
11909
                         UserBillEnum::TYPE_SHOP['Platform']['code'],
11867
                         $storeOrderEntity->getOrderId(),
11910
                         $storeOrderEntity->getOrderId(),
11868
                         UserBillEnum::COMMISSION_TYPE['LOCKED_CUSTOMER']['code'],
11911
                         UserBillEnum::COMMISSION_TYPE['LOCKED_CUSTOMER']['code'],
@@ -11871,12 +11914,12 @@ class StoreOrderRepository extends BaseRepository
11871
                     );
11914
                     );
11872
 
11915
 
11873
                     // 计算 复购金
11916
                     // 计算 复购金
11874
-                    $fugouByMerId = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Lock']['Fugou']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11917
+                    $fugouByMerId = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['CommercialDistrict']['Lock']['Fugou']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11875
                     // 添加复购金记录
11918
                     // 添加复购金记录
11876
                     /** @var UserSignFugouRepository $userSignFugouRepository */
11919
                     /** @var UserSignFugouRepository $userSignFugouRepository */
11877
                     $userSignFugouRepository = app()->make(UserSignFugouRepository::class);
11920
                     $userSignFugouRepository = app()->make(UserSignFugouRepository::class);
11878
                     $userSignFugouRepository->addUserSingFugou(
11921
                     $userSignFugouRepository->addUserSingFugou(
11879
-                        $merchantEntity->getUid(),
11922
+                        $merchantEntityByLock->getUid(),
11880
                         UserSignFugouEnum::TYPE['Give']['code'],
11923
                         UserSignFugouEnum::TYPE['Give']['code'],
11881
                         $fugouByMerId,
11924
                         $fugouByMerId,
11882
                         '锁客复购金(精彩生活区商品赠送)',
11925
                         '锁客复购金(精彩生活区商品赠送)',
@@ -11886,7 +11929,119 @@ class StoreOrderRepository extends BaseRepository
11886
                 }
11929
                 }
11887
             }
11930
             }
11888
 
11931
 
11889
-            // 商户收益 todo
11932
+            // 商户收益 给商户 京豆
11933
+            /** @var MerchantContributionRepository $merchantContributionRepository */
11934
+            $merchantContributionRepository = app()->make(MerchantContributionRepository::class);
11935
+            $merchantContributionEntity = $merchantContributionRepository->getMerchantContributionEntityByProfitSharing($storeOrderEntity->getExtensionOne());
11936
+            if (!empty($merchantContributionEntity->getId())) {
11937
+                /** @var UserSignJingdouRepository $userSignJingdouRepository */
11938
+                $userSignJingdouRepository = app()->make(UserSignJingdouRepository::class);
11939
+                $userSignJingdouRepository->addUserSingJingdou(
11940
+                    $merchantEntity->getUid(),
11941
+                    UserSignJingdouEnum::TYPE['Gift']['code'],
11942
+                    bcmul($storeOrderEntity->getConPri(), $merchantContributionEntity->getJd(), CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT),
11943
+                    $storeOrderEntity->getMerId(),
11944
+                    '线上用户消费商家获得京豆',
11945
+                    UserSignFugouEnum::ORDER_TYPE['Platform']['code'],
11946
+                    $storeOrderEntity->getOrderId()
11947
+                );
11948
+            }
11949
+        }
11950
+    }
11951
+
11952
+    public function settlementOrderByOrderIdList(array $orderIdList)
11953
+    {
11954
+        /** @var StoreOrderRepository $storeOrderRepository */
11955
+        $storeOrderRepository = app()->make(StoreOrderRepository::class);
11956
+        $storeOrderEntityList = $storeOrderRepository->getStoreOrderEntityListByOrderIdList($orderIdList);
11957
+        if (!empty($storeOrderEntityList)) {
11958
+            $existOrderIdList = array_map(function ($storeOrderEntity) {
11959
+                if ($storeOrderEntity->getIsSettlement() == StoreOrderEnum::IS_SETTLEMENT['NO']['code']) {
11960
+                    return $storeOrderEntity->getOrderId();
11961
+                }
11962
+            }, $storeOrderEntityList);
11963
+
11964
+            /** @var UserBillRepository $userBillRepository */
11965
+            $userBillRepository = app()->make(UserBillRepository::class);
11966
+            $userBillEntityList = $userBillRepository->getUserBillEntityListByOrderIdListAndPending(UserBillEnum::TYPE_SHOP['Platform']['code'], $existOrderIdList);
11967
+            if (!empty($userBillEntityList)) {
11968
+                foreach ($userBillEntityList as $userBillEntity) {
11969
+                    if ($userBillEntity->getCommissionType() == UserBillEnum::COMMISSION_TYPE['PENSION']['code']) {
11970
+                        // 养老金 todo
11971
+                    }
11972
+                }
11973
+            }
11974
+
11975
+
11976
+
11977
+            foreach ($storeOrderEntityList as $storeOrderEntity) {
11978
+                // 结算养老金
11979
+                $yanglaojin = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Self']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11980
+                /** @var UserBillRepository $userBillRepository */
11981
+                $userBillRepository = app()->make(UserBillRepository::class);
11982
+                $userBillRepository->addUserBill(
11983
+                    $storeOrderEntity->getUid(),
11984
+                    UserBillEnum::TYPE_SHOP['Platform']['code'],
11985
+                    $storeOrderEntity->getOrderId(),
11986
+                    UserBillEnum::COMMISSION_TYPE['PENSION']['code'],
11987
+                    $yanglaojin,
11988
+                    '购买精彩生活商品赠送养老金'
11989
+                );
11990
+
11991
+                // 为用户初始胡 贡献值
11992
+                $gongxian = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Self']['Gongxian']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11993
+                /** @var UserSignGongxianRepository $userSignGongxianRepository */
11994
+                $userSignGongxianRepository = app()->make(UserSignGongxianRepository::class);
11995
+                $userSignGongxianRepository->addUserSingGongxian(
11996
+                    $storeOrderEntity->getUid(),
11997
+                    UserSignGongxianEnum::TYPE['Give']['code'],
11998
+                    $gongxian,
11999
+                    '购买精彩生活商品赠送贡献值',
12000
+                    UserSignGongxianEnum::ORDER_TYPE['Platform']['code'],
12001
+                    $storeOrderEntity->getOrderId()
12002
+                );
12003
+
12004
+                // 初始化 PV
12005
+                $pv = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Self']['Pv']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
12006
+                /** @var UserPvLogRepository $userPvLogRepository */
12007
+                $userPvLogRepository = app()->make(UserPvLogRepository::class);
12008
+                $userPvLogRepository->addUserPvLog(
12009
+                    $storeOrderEntity->getUid(),
12010
+                    $pv,
12011
+                    '购买精彩生活商品赠送PV值',
12012
+                    UserPvLogEnum::ORDER_TYPE['Platform']['code'],
12013
+                    $storeOrderEntity->getOrderId()
12014
+                );
12015
+
12016
+                // 初始化积分
12017
+                $score = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Self']['Score']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
12018
+                /** @var UserSignScoreRepository $userSignScoreRepository */
12019
+                $userSignScoreRepository = app()->make(UserSignScoreRepository::class);
12020
+                $userSignScoreRepository->addUserSingScore(
12021
+                    $storeOrderEntity->getUid(),
12022
+                    UserSignScoreEnum::SOURCE_TYPE['SelfOrder']['code'],
12023
+                    UserSignScoreEnum::PM['Income']['code'],
12024
+                    $score,
12025
+                    '购买精彩生活商品赠送积分',
12026
+                    UserSignHongbaoEnum::ORDER_TYPE['Platform']['code'],
12027
+                    $storeOrderEntity->getOrderId()
12028
+                );
12029
+
12030
+                // 给老用户的奖励 红包
12031
+                if ($userEntity->getIsOld()) {
12032
+                    $hongbao =  bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Self']['Hongbao']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
12033
+                    /** @var UserSignHongbaoRepository $userSignHongbaoRepository */
12034
+                    $userSignHongbaoRepository = app()->make(UserSignHongbaoRepository::class);
12035
+                    $userSignHongbaoRepository->addUserSingHongbao(
12036
+                        $storeOrderEntity->getUid(),
12037
+                        UserSignHongbaoEnum::TYPE['ConsumptionGift']['code'],
12038
+                        $hongbao,
12039
+                        '购买精彩生活商品赠送红包',
12040
+                        UserSignHongbaoEnum::ORDER_TYPE['Platform']['code'],
12041
+                        $storeOrderEntity->getOrderId()
12042
+                    );
12043
+                }
12044
+            }
11890
         }
12045
         }
11891
     }
12046
     }
11892
 }
12047
 }

+ 35 - 0
app/common/repositories/system/merchant/MerchantContributionRepository.php

@@ -0,0 +1,35 @@
1
+<?php
2
+
3
+namespace app\common\repositories\system\merchant;
4
+
5
+use app\common\dao\system\merchant\MerchantContributionDao;
6
+use app\common\repositories\BaseRepository;
7
+use app\entity\data\merchant\MerchantContributionEntity;
8
+
9
+class MerchantContributionRepository extends BaseRepository
10
+{
11
+    /**
12
+     * @var MerchantContributionDao
13
+     */
14
+    protected $dao;
15
+
16
+    /**
17
+     * @param MerchantContributionDao $dao
18
+     */
19
+    public function __construct(MerchantContributionDao $dao)
20
+    {
21
+        $this->dao = $dao;
22
+    }
23
+
24
+    /**
25
+     * 根据商家的让利比例 获取对应的 配置信息
26
+     * @param float $profitSharing
27
+     * @return MerchantContributionEntity
28
+     */
29
+    public function getMerchantContributionEntityByProfitSharing(float $profitSharing): MerchantContributionEntity
30
+    {
31
+        /** @var MerchantContributionEntity $entity */
32
+        $entity = $this->dao->getMerchantContributionEntityByProfitSharing($profitSharing);
33
+        return $entity;
34
+    }
35
+}

+ 12 - 1
app/common/repositories/user/UserBillRepository.php

@@ -5,7 +5,7 @@
5
  * @author xaboy
5
  * @author xaboy
6
  * @day 2020-05-07
6
  * @day 2020-05-07
7
  *
7
  *
8
- * 
8
+ *
9
  */
9
  */
10
 
10
 
11
 namespace app\common\repositories\user;
11
 namespace app\common\repositories\user;
@@ -468,4 +468,15 @@ class UserBillRepository extends BaseRepository
468
             throw new ValidateException('更新记录状态失败');
468
             throw new ValidateException('更新记录状态失败');
469
         }
469
         }
470
     }
470
     }
471
+
472
+    /**
473
+     * 获取Bill实体集合 根据 订单类型 订单Id集合 待结算状态
474
+     * @param string $typeShop
475
+     * @param array $orderIdList
476
+     * @return UserBillEntity[]
477
+     */
478
+    public function getUserBillEntityListByOrderIdListAndPending(string $typeShop, array $orderIdList): array
479
+    {
480
+        return $this->dao->getUserBillEntityListByOrderIdListAndPending($typeShop, $orderIdList);
481
+    }
471
 }
482
 }

+ 73 - 0
app/common/repositories/user/UserSignFenrunRepository.php

@@ -0,0 +1,73 @@
1
+<?php
2
+
3
+namespace app\common\repositories\user;
4
+
5
+use app\common\dao\user\UserSignFenrunDao;
6
+use app\common\enum\user\UserSignFenrunEnum;
7
+use app\common\repositories\BaseRepository;
8
+use app\common\repositories\store\order\StoreOrderRepository;
9
+use app\entity\data\user\UserSignFenrunEntity;
10
+use think\exception\ValidateException;
11
+
12
+class UserSignFenrunRepository extends BaseRepository
13
+{
14
+    public function __construct(UserSignFenrunDao $dao)
15
+    {
16
+        $this->dao = $dao;
17
+    }
18
+
19
+    public function create($data)
20
+    {
21
+        return $this->dao->create($data);
22
+    }
23
+
24
+    /**
25
+     * 写入分润记录
26
+     * @param UserSignFenrunEntity $userSignFenrunEntity
27
+     * @return UserSignFenrunEntity
28
+     */
29
+    public function createByEntity(UserSignFenrunEntity $userSignFenrunEntity): UserSignFenrunEntity
30
+    {
31
+        $result = $this->dao->create($userSignFenrunEntity->toUnderlineArray())->toArray();
32
+        /** @var UserSignFenrunEntity $entity */
33
+        $entity = UserSignFenrunEntity::newInstance($result);
34
+        return $entity;
35
+    }
36
+
37
+    /**
38
+     * 添加分润记录
39
+     * @param int $uid
40
+     * @param float $number
41
+     * @param string $mark
42
+     * @param string $orderType
43
+     * @param string $orderId
44
+     * @return UserSignFenrunEntity
45
+     */
46
+    public function addUserSingFenrun(int $uid, float $number, string $mark = '', string $orderType = '', string $orderId = ''): UserSignFenrunEntity
47
+    {
48
+        if (!empty($orderType)) {
49
+            if (!empty($orderId)) {
50
+                if ($orderType == UserSignFenrunEnum::ORDER_TYPE['Platform']['code']) {
51
+                    /** @var StoreOrderRepository $storeOrderRepository */
52
+                    $storeOrderRepository = app()->make(StoreOrderRepository::class);
53
+                    $storeOrderEntity = $storeOrderRepository->getStoreOrderEntityByOrderId((int)$orderId);
54
+                    if (empty($storeOrderEntity->getOrderId())) {
55
+                        throw new ValidateException('未查询到订单信息');
56
+                    }
57
+                }
58
+            }
59
+        }
60
+
61
+        /** @var UserSignFenrunEntity $userSignFenrunEntity */
62
+        $userSignFenrunEntity = UserSignFenrunEntity::newInstance();
63
+        $userSignFenrunEntity->setUid($uid)
64
+            ->setNumber($number)
65
+            ->setMark($mark)
66
+            ->setOrderType($orderType)
67
+            ->setOrderId($orderId)
68
+            ->setAddtime(time())
69
+            ->setStatus(UserSignFenrunEnum::STATUS['Unsettled']['code']);
70
+
71
+        return $this->createByEntity($userSignFenrunEntity);
72
+    }
73
+}

+ 57 - 0
app/common/repositories/user/UserSignJingdouRepository.php

@@ -3,7 +3,11 @@
3
 namespace app\common\repositories\user;
3
 namespace app\common\repositories\user;
4
 
4
 
5
 use app\common\dao\user\UserSignJingdouDao;
5
 use app\common\dao\user\UserSignJingdouDao;
6
+use app\common\enum\user\UserSignJingdouEnum;
6
 use app\common\repositories\BaseRepository;
7
 use app\common\repositories\BaseRepository;
8
+use app\common\repositories\store\order\StoreOrderRepository;
9
+use app\entity\data\user\UserSignJingdouEntity;
10
+use think\exception\ValidateException;
7
 
11
 
8
 class UserSignJingdouRepository extends BaseRepository
12
 class UserSignJingdouRepository extends BaseRepository
9
 {
13
 {
@@ -16,4 +20,57 @@ class UserSignJingdouRepository extends BaseRepository
16
     {
20
     {
17
         return $this->dao->create($data);
21
         return $this->dao->create($data);
18
     }
22
     }
23
+
24
+    /**
25
+     * 写入京豆记录
26
+     * @param UserSignJingdouEntity $userSignJingdouEntity
27
+     * @return UserSignJingdouEntity
28
+     */
29
+    public function createByEntity(UserSignJingdouEntity $userSignJingdouEntity): UserSignJingdouEntity
30
+    {
31
+        $result = $this->dao->create($userSignJingdouEntity->toUnderlineArray())->toArray();
32
+        /** @var UserSignJingdouEntity $entity */
33
+        $entity = UserSignJingdouEntity::newInstance($result);
34
+        return $entity;
35
+    }
36
+
37
+    /**
38
+     * 添加京豆记录
39
+     * @param int $uid
40
+     * @param int $type
41
+     * @param float $number
42
+     * @param string $mark
43
+     * @param string $orderType
44
+     * @param string $orderId
45
+     * @return UserSignJingdouEntity
46
+     */
47
+    public function addUserSingJingdou(int $uid, int $type, float $number, int $merId, string $mark = '', string $orderType = '', string $orderId = ''): UserSignJingdouEntity
48
+    {
49
+        if (!empty($orderType)) {
50
+            if (!empty($orderId)) {
51
+                if ($orderType == UserSignJingdouEnum::ORDER_TYPE['Platform']['code']) {
52
+                    /** @var StoreOrderRepository $storeOrderRepository */
53
+                    $storeOrderRepository = app()->make(StoreOrderRepository::class);
54
+                    $storeOrderEntity = $storeOrderRepository->getStoreOrderEntityByOrderId((int)$orderId);
55
+                    if (empty($storeOrderEntity->getOrderId())) {
56
+                        throw new ValidateException('未查询到订单信息');
57
+                    }
58
+                }
59
+            }
60
+        }
61
+
62
+        /** @var UserSignJingdouEntity $userSignJingdouEntity */
63
+        $userSignJingdouEntity = UserSignJingdouEntity::newInstance();
64
+        $userSignJingdouEntity->setUid($uid)
65
+            ->setType($type)
66
+            ->setNumber($number)
67
+            ->setMerId($merId)
68
+            ->setMark($mark)
69
+            ->setOrderType($orderType)
70
+            ->setOrderId($orderId)
71
+            ->setAddtime(time())
72
+            ->setStatus(UserSignJingdouEnum::STATUS['PendingConfirmation']['code']);
73
+
74
+        return $this->createByEntity($userSignJingdouEntity);
75
+    }
19
 }
76
 }

+ 161 - 0
app/entity/data/merchant/MerchantContributionEntity.php

@@ -0,0 +1,161 @@
1
+<?php
2
+
3
+namespace app\entity\data\merchant;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class MerchantContributionEntity extends DataEntity
8
+{
9
+    public $id = 0;  // 自增id
10
+    public $title = '';  // 名称
11
+    public $start = 0;  // 开始百分数
12
+    public $end = 0;  // 结束百分数
13
+    public $type = '赠送';  // 类型
14
+    public $jd = 0.00;  // 京豆
15
+    public $value = 0.00;  // 贡献值
16
+    public $createTime = 0;  // 创建时间
17
+
18
+    /**
19
+     * @return int
20
+     */
21
+    public function getId(): int
22
+    {
23
+        return $this->id;
24
+    }
25
+
26
+    /**
27
+     * @param int $id
28
+     * @return MerchantContributionEntity
29
+     */
30
+    public function setId(int $id): MerchantContributionEntity
31
+    {
32
+        $this->id = $id;
33
+        return $this;
34
+    }
35
+
36
+    /**
37
+     * @return string
38
+     */
39
+    public function getTitle(): string
40
+    {
41
+        return $this->title;
42
+    }
43
+
44
+    /**
45
+     * @param string $title
46
+     * @return MerchantContributionEntity
47
+     */
48
+    public function setTitle(string $title): MerchantContributionEntity
49
+    {
50
+        $this->title = $title;
51
+        return $this;
52
+    }
53
+
54
+    /**
55
+     * @return int
56
+     */
57
+    public function getStart(): int
58
+    {
59
+        return $this->start;
60
+    }
61
+
62
+    /**
63
+     * @param int $start
64
+     * @return MerchantContributionEntity
65
+     */
66
+    public function setStart(int $start): MerchantContributionEntity
67
+    {
68
+        $this->start = $start;
69
+        return $this;
70
+    }
71
+
72
+    /**
73
+     * @return int
74
+     */
75
+    public function getEnd(): int
76
+    {
77
+        return $this->end;
78
+    }
79
+
80
+    /**
81
+     * @param int $end
82
+     * @return MerchantContributionEntity
83
+     */
84
+    public function setEnd(int $end): MerchantContributionEntity
85
+    {
86
+        $this->end = $end;
87
+        return $this;
88
+    }
89
+
90
+    /**
91
+     * @return string
92
+     */
93
+    public function getType(): string
94
+    {
95
+        return $this->type;
96
+    }
97
+
98
+    /**
99
+     * @param string $type
100
+     * @return MerchantContributionEntity
101
+     */
102
+    public function setType(string $type): MerchantContributionEntity
103
+    {
104
+        $this->type = $type;
105
+        return $this;
106
+    }
107
+
108
+    /**
109
+     * @return float
110
+     */
111
+    public function getJd(): float
112
+    {
113
+        return $this->jd;
114
+    }
115
+
116
+    /**
117
+     * @param float $jd
118
+     * @return MerchantContributionEntity
119
+     */
120
+    public function setJd(float $jd): MerchantContributionEntity
121
+    {
122
+        $this->jd = $jd;
123
+        return $this;
124
+    }
125
+
126
+    /**
127
+     * @return float
128
+     */
129
+    public function getValue(): float
130
+    {
131
+        return $this->value;
132
+    }
133
+
134
+    /**
135
+     * @param float $value
136
+     * @return MerchantContributionEntity
137
+     */
138
+    public function setValue(float $value): MerchantContributionEntity
139
+    {
140
+        $this->value = $value;
141
+        return $this;
142
+    }
143
+
144
+    /**
145
+     * @return int
146
+     */
147
+    public function getCreateTime(): int
148
+    {
149
+        return $this->createTime;
150
+    }
151
+
152
+    /**
153
+     * @param int $createTime
154
+     * @return MerchantContributionEntity
155
+     */
156
+    public function setCreateTime(int $createTime): MerchantContributionEntity
157
+    {
158
+        $this->createTime = $createTime;
159
+        return $this;
160
+    }
161
+}

+ 6 - 6
app/entity/data/store/StoreOrderEntity.php

@@ -1557,20 +1557,20 @@ class StoreOrderEntity extends DataEntity
1557
     }
1557
     }
1558
 
1558
 
1559
     /**
1559
     /**
1560
-     * @return null
1560
+     * @return float
1561
      */
1561
      */
1562
-    public function getConPri()
1562
+    public function getConPri(): float
1563
     {
1563
     {
1564
-        return $this->conPri;
1564
+        return (float)$this->conPri;
1565
     }
1565
     }
1566
 
1566
 
1567
     /**
1567
     /**
1568
-     * @param null $conPri
1568
+     * @param mixed $conPri
1569
      * @return StoreOrderEntity
1569
      * @return StoreOrderEntity
1570
      */
1570
      */
1571
-    public function setConPri($conPri)
1571
+    public function setConPri($conPri): StoreOrderEntity
1572
     {
1572
     {
1573
-        $this->conPri = $conPri;
1573
+        $this->conPri = (float)$conPri;
1574
         return $this;
1574
         return $this;
1575
     }
1575
     }
1576
 
1576
 

+ 199 - 0
app/entity/data/user/UserSignFenrunEntity.php

@@ -0,0 +1,199 @@
1
+<?php
2
+
3
+namespace app\entity\data\user;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class UserSignFenrunEntity extends DataEntity
8
+{
9
+    public $id = 0;  // 自增id
10
+    public $uid = 0;  // 会员id
11
+    public $number = 0.00;  // 数量
12
+    public $status = 0;  // 状态1已结算 0-已失效 -1未结算
13
+    public $mark = '';  // 备注
14
+    public $desc = '';  // 描述
15
+    public $orderId = '';  // 订单id
16
+    public $orderType = '';  // 订单类型。关联订单ID
17
+    public $settlementTime = null;  // 结算时间
18
+    public $addtime = 0;
19
+
20
+    /**
21
+     * @return int
22
+     */
23
+    public function getId(): int
24
+    {
25
+        return $this->id;
26
+    }
27
+
28
+    /**
29
+     * @param int $id
30
+     * @return UserSignFenrunEntity
31
+     */
32
+    public function setId(int $id): UserSignFenrunEntity
33
+    {
34
+        $this->id = $id;
35
+        return $this;
36
+    }
37
+
38
+    /**
39
+     * @return int
40
+     */
41
+    public function getUid(): int
42
+    {
43
+        return $this->uid;
44
+    }
45
+
46
+    /**
47
+     * @param int $uid
48
+     * @return UserSignFenrunEntity
49
+     */
50
+    public function setUid(int $uid): UserSignFenrunEntity
51
+    {
52
+        $this->uid = $uid;
53
+        return $this;
54
+    }
55
+
56
+    /**
57
+     * @return float
58
+     */
59
+    public function getNumber(): float
60
+    {
61
+        return $this->number;
62
+    }
63
+
64
+    /**
65
+     * @param float $number
66
+     * @return UserSignFenrunEntity
67
+     */
68
+    public function setNumber(float $number): UserSignFenrunEntity
69
+    {
70
+        $this->number = $number;
71
+        return $this;
72
+    }
73
+
74
+    /**
75
+     * @return int
76
+     */
77
+    public function getStatus(): int
78
+    {
79
+        return $this->status;
80
+    }
81
+
82
+    /**
83
+     * @param int $status
84
+     * @return UserSignFenrunEntity
85
+     */
86
+    public function setStatus(int $status): UserSignFenrunEntity
87
+    {
88
+        $this->status = $status;
89
+        return $this;
90
+    }
91
+
92
+    /**
93
+     * @return string
94
+     */
95
+    public function getMark(): string
96
+    {
97
+        return $this->mark;
98
+    }
99
+
100
+    /**
101
+     * @param string $mark
102
+     * @return UserSignFenrunEntity
103
+     */
104
+    public function setMark(string $mark): UserSignFenrunEntity
105
+    {
106
+        $this->mark = $mark;
107
+        return $this;
108
+    }
109
+
110
+    /**
111
+     * @return string
112
+     */
113
+    public function getDesc(): string
114
+    {
115
+        return $this->desc;
116
+    }
117
+
118
+    /**
119
+     * @param string $desc
120
+     * @return UserSignFenrunEntity
121
+     */
122
+    public function setDesc(string $desc): UserSignFenrunEntity
123
+    {
124
+        $this->desc = $desc;
125
+        return $this;
126
+    }
127
+
128
+    /**
129
+     * @return string
130
+     */
131
+    public function getOrderId(): string
132
+    {
133
+        return $this->orderId;
134
+    }
135
+
136
+    /**
137
+     * @param string $orderId
138
+     * @return UserSignFenrunEntity
139
+     */
140
+    public function setOrderId(string $orderId): UserSignFenrunEntity
141
+    {
142
+        $this->orderId = $orderId;
143
+        return $this;
144
+    }
145
+
146
+    /**
147
+     * @return string
148
+     */
149
+    public function getOrderType(): string
150
+    {
151
+        return $this->orderType;
152
+    }
153
+
154
+    /**
155
+     * @param string $orderType
156
+     * @return UserSignFenrunEntity
157
+     */
158
+    public function setOrderType(string $orderType): UserSignFenrunEntity
159
+    {
160
+        $this->orderType = $orderType;
161
+        return $this;
162
+    }
163
+
164
+    /**
165
+     * @return mixed
166
+     */
167
+    public function getSettlementTime()
168
+    {
169
+        return $this->settlementTime;
170
+    }
171
+
172
+    /**
173
+     * @param mixed $settlementTime
174
+     * @return UserSignFenrunEntity
175
+     */
176
+    public function setSettlementTime($settlementTime): UserSignFenrunEntity
177
+    {
178
+        $this->settlementTime = $settlementTime;
179
+        return $this;
180
+    }
181
+
182
+    /**
183
+     * @return int
184
+     */
185
+    public function getAddtime(): int
186
+    {
187
+        return $this->addtime;
188
+    }
189
+
190
+    /**
191
+     * @param int $addtime
192
+     * @return UserSignFenrunEntity
193
+     */
194
+    public function setAddtime(int $addtime): UserSignFenrunEntity
195
+    {
196
+        $this->addtime = $addtime;
197
+        return $this;
198
+    }  // 添加时间
199
+}