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

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

sunxbiao 1 год назад
Родитель
Сommit
13e5f43b98
29 измененных файлов с 2587 добавлено и 24 удалено
  1. 24 0
      app/common/dao/store/order/StoreOrderDao.php
  2. 14 0
      app/common/dao/user/UserSignFugouDao.php
  3. 14 0
      app/common/dao/user/UserSignJingdouDao.php
  4. 14 0
      app/common/dao/user/UserSignScoreDao.php
  5. 14 0
      app/common/dao/user/UserSignVrDao.php
  6. 26 0
      app/common/enum/CommonEnum.php
  7. 42 0
      app/common/enum/store/StoreGroupOrderEnum.php
  8. 60 0
      app/common/enum/store/StoreOrderEnum.php
  9. 73 0
      app/common/enum/user/UserBillEnum.php
  10. 38 0
      app/common/enum/user/UserSignFugouEnum.php
  11. 21 0
      app/common/enum/user/UserSignJingdouEnum.php
  12. 30 0
      app/common/enum/user/UserSignScoreEnum.php
  13. 14 0
      app/common/enum/user/UserSignVrEnum.php
  14. 19 0
      app/common/model/user/UserSignFugou.php
  15. 19 0
      app/common/model/user/UserSignJingdou.php
  16. 19 0
      app/common/model/user/UserSignScore.php
  17. 19 0
      app/common/model/user/UserSignVr.php
  18. 288 24
      app/common/repositories/store/order/StoreOrderRepository.php
  19. 200 0
      app/common/repositories/user/UserRepository.php
  20. 19 0
      app/common/repositories/user/UserSignFugouRepository.php
  21. 19 0
      app/common/repositories/user/UserSignJingdouRepository.php
  22. 19 0
      app/common/repositories/user/UserSignScoreRepository.php
  23. 19 0
      app/common/repositories/user/UserSignVrRepository.php
  24. 523 0
      app/entity/data/user/UserBillEntity.php
  25. 256 0
      app/entity/data/user/UserSignFugouEntity.php
  26. 256 0
      app/entity/data/user/UserSignJingdouEntity.php
  27. 294 0
      app/entity/data/user/UserSignScoreEntity.php
  28. 218 0
      app/entity/data/user/UserSignVrEntity.php
  29. 16 0
      app/utils/ArrayUtil.php

+ 24 - 0
app/common/dao/store/order/StoreOrderDao.php

@@ -16,6 +16,8 @@ use app\common\model\BaseModel;
16 16
 use app\common\model\store\order\StoreOrder;
17 17
 use app\common\model\user\User;
18 18
 use app\common\repositories\user\UserRepository;
19
+use app\entity\CommonEntity;
20
+use app\entity\data\store\StoreOrderEntity;
19 21
 use think\facade\Db;
20 22
 
21 23
 /**
@@ -603,4 +605,26 @@ class StoreOrderDao extends BaseDao
603 605
         $userData = Db::query($sql);
604 606
         return array_column($userData, 'amount', 'uid');
605 607
     }
608
+
609
+    /**
610
+     * @param $orderId
611
+     * @return CommonEntity
612
+     */
613
+    public function getStoreOrderEntityByOrderId($orderId): CommonEntity
614
+    {
615
+        $data = [];
616
+        try {
617
+            /** @var StoreOrder $model */
618
+            $model = $this->getModel();
619
+            $dataRes = $model::getDB()
620
+                ->where('order_id', '=', $orderId)
621
+                ->find();
622
+            if (!empty($dataRes)) {
623
+                $data = $dataRes->toArray();
624
+            }
625
+        } catch (\Exception $e) {
626
+
627
+        }
628
+        return StoreOrderEntity::newInstance($data);
629
+    }
606 630
 }

+ 14 - 0
app/common/dao/user/UserSignFugouDao.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\UserSignFugou;
7
+
8
+class UserSignFugouDao extends BaseDao
9
+{
10
+    protected function getModel(): string
11
+    {
12
+        return UserSignFugou::class;
13
+    }
14
+}

+ 14 - 0
app/common/dao/user/UserSignJingdouDao.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\UserSignJingdou;
7
+
8
+class UserSignJingdouDao extends BaseDao
9
+{
10
+    protected function getModel(): string
11
+    {
12
+        return UserSignJingdou::class;
13
+    }
14
+}

+ 14 - 0
app/common/dao/user/UserSignScoreDao.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\UserSignScore;
7
+
8
+class UserSignScoreDao extends BaseDao
9
+{
10
+    protected function getModel(): string
11
+    {
12
+        return UserSignScore::class;
13
+    }
14
+}

+ 14 - 0
app/common/dao/user/UserSignVrDao.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\UserSignVr;
7
+
8
+class UserSignVrDao extends BaseDao
9
+{
10
+    protected function getModel(): string
11
+    {
12
+        return UserSignVr::class;
13
+    }
14
+}

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

@@ -18,4 +18,30 @@ class CommonEnum
18 18
         'Yes' => ['code' => 1, 'name' => '已删除'],
19 19
         'Pending' => ['code' => 2, 'name' => '待删除']
20 20
     ];
21
+
22
+    // 订单类型:根据业务需要进一步扩展
23
+    const ORDER_TYPE = [
24
+        'Platform' => ['code' => 0, 'name' => '平台'],
25
+        'DuoduoJinbao' => ['code' => 1, 'name' => '多多进宝'],
26
+        'Vipshop' => ['code' => 2, 'name' => '唯品会'],
27
+        'SuningYigou' => ['code' => 3, 'name' => '苏宁易购'],
28
+        'NetEaseKaola' => ['code' => 4, 'name' => '网易考拉'],
29
+        'TaobaoKe' => ['code' => 5, 'name' => '淘宝客'],
30
+        'JingdongUnion' => ['code' => 6, 'name' => '京东联盟'],
31
+        'Eleme' => ['code' => 7, 'name' => '饿了么'],
32
+        'Online' => ['code' => 8, 'name' => '线上'],
33
+        'MobileTopUp' => ['code' => 9, 'name' => '话费'],
34
+        'Offline' => ['code' => 10, 'name' => '线下'],
35
+        'Platform-Group' => ['code' => 1000, 'name' => '平台-GroupId'], // 该中类型时,依然是 平台订单,只不过 表中的order_id 存储的是
36
+        'XingfuXiaodian' => ['code' => 2001, 'name' => '幸福小店'],
37
+    ];
38
+
39
+    CONST YANGLAOJIN = [
40
+        'Ratio' => ['code' => 0.3, 'name' => '30%']
41
+    ];
42
+
43
+    CONST PV = [
44
+        'Ratio' => ['code' => 0.35, 'name' => '35%']
45
+    ];
46
+
21 47
 }

+ 42 - 0
app/common/enum/store/StoreGroupOrderEnum.php

@@ -0,0 +1,42 @@
1
+<?php
2
+
3
+namespace app\common\enum\store;
4
+
5
+use app\common\enum\CommonEnum;
6
+
7
+class StoreGroupOrderEnum extends CommonEnum
8
+{
9
+    // 支付方式
10
+    const PAY_TYPE = [
11
+        'BALANCE' => ['code' => 0, 'name' => '余额支付'],
12
+        'WECHAT' => ['code' => 1, 'name' => '微信支付'],
13
+        'MINI_PROGRAM' => ['code' => 2, 'name' => '小程序支付'],
14
+        'H5' => ['code' => 3, 'name' => 'H5支付'],
15
+        'ALIPAY' => ['code' => 4, 'name' => '支付宝支付'],
16
+    ];
17
+
18
+    // 分账状态
19
+    const SPLIT_STATUS = [
20
+        'NOT_SPLIT' => ['code' => 0, 'name' => '未分账'],
21
+        'SPLIT_SUCCESS' => ['code' => 1, 'name' => '分账成功'],
22
+        'SPLIT_FAILED' => ['code' => 2, 'name' => '分账失败'],
23
+    ];
24
+
25
+    // 是否提醒
26
+    const IS_REMIND = [
27
+        'NO' => ['code' => 0, 'name' => '不提醒'],
28
+        'YES' => ['code' => 1, 'name' => '提醒'],
29
+    ];
30
+
31
+    // 是否为测试订单
32
+    const TEST_ORDER = [
33
+        'NO' => ['code' => 0, 'name' => '不是测试订单'],
34
+        'YES' => ['code' => 1, 'name' => '是测试订单'],
35
+    ];
36
+
37
+    // 支付状态
38
+    const PAID = [
39
+        'NO' => ['code' => 0, 'name' => '未支付'],
40
+        'YES' => ['code' => 1, 'name' => '已支付'],
41
+    ];
42
+}

+ 60 - 0
app/common/enum/store/StoreOrderEnum.php

@@ -46,4 +46,64 @@ class StoreOrderEnum extends CommonEnum
46 46
         'C1-Fugou' => ['code' => 'c1', 'name' => '复购金'],
47 47
     ];
48 48
 
49
+    // 订单状态
50
+    const STATUS = [
51
+        'WAITING_SHIPMENT' => ['code' => 0, 'name' => '待发货'],
52
+        'WAITING_RECEIVE' => ['code' => 1, 'name' => '待收货'],
53
+        'WAITING_EVALUATION' => ['code' => 2, 'name' => '待评价'],
54
+        'COMPLETED' => ['code' => 3, 'name' => '已完成'],
55
+        'REFUND_REQUESTED' => ['code' => 4, 'name' => '已申请退款'],
56
+        'REFUNDED' => ['code' => -1, 'name' => '已退款'],
57
+        'UNPAID' => ['code' => 5, 'name' => '未支付'],
58
+        'CANCELLED' => ['code' => 6, 'name' => '已取消'],
59
+    ];
60
+
61
+    // 支付状态
62
+    const PAID_STATUS = [
63
+        'UNPAID' => ['code' => 0, 'name' => '未支付'],
64
+        'PAID' => ['code' => 1, 'name' => '已支付'],
65
+    ];
66
+
67
+    // 支付方式
68
+    const PAY_TYPE = [
69
+        'BALANCE' => ['code' => 0, 'name' => '余额支付'],
70
+        'WECHAT' => ['code' => 1, 'name' => '微信支付'],
71
+        'MINI_PROGRAM' => ['code' => 2, 'name' => '小程序支付'],
72
+        'ALIPAY' => ['code' => 4, 'name' => '支付宝支付'],
73
+        'SPECIAL_MERCHANT_POINTS' => ['code' => 5, 'name' => '特殊商户积分'],
74
+    ];
75
+
76
+    // 订单类型
77
+    const ORDER_TYPE = [
78
+        'ORDINARY' => ['code' => 0, 'name' => '普通订单'],
79
+        'PICKUP' => ['code' => 1, 'name' => '自提订单'],
80
+    ];
81
+
82
+    // 发货类型
83
+    const DELIVERY_TYPE = [
84
+        'DELIVERY' => ['code' => 1, 'name' => '发货'],
85
+        'DELIVERY_PERSON' => ['code' => 2, 'name' => '送货'],
86
+        'VIRTUAL' => ['code' => 3, 'name' => '虚拟商品'],
87
+    ];
88
+
89
+    // 是否分账
90
+    const IS_INDEPENDENT_ACCOUNT = [
91
+        'NO' => ['code' => 0, 'name' => '否'],
92
+        'YES' => ['code' => 1, 'name' => '是'],
93
+    ];
94
+
95
+    // 退款状态
96
+    const REFUND_STATUS = [
97
+        'WAITING_REVIEW' => ['code' => 0, 'name' => '待审核'],
98
+        'REVIEW_FAILED' => ['code' => -1, 'name' => '审核未通过'],
99
+        'WAITING_RETURN' => ['code' => 1, 'name' => '待退货'],
100
+        'WAITING_RECEIVE' => ['code' => 2, 'name' => '待收货'],
101
+        'REFUNDED' => ['code' => 3, 'name' => '已退款'],
102
+    ];
103
+
104
+    // 支付状态
105
+    const PAID = [
106
+        'NO' => ['code' => 0, 'name' => '未支付'],
107
+        'YES' => ['code' => 1, 'name' => '已支付'],
108
+    ];
49 109
 }

+ 73 - 0
app/common/enum/user/UserBillEnum.php

@@ -0,0 +1,73 @@
1
+<?php
2
+
3
+namespace app\common\enum\user;
4
+
5
+use app\common\enum\CommonEnum;
6
+
7
+class UserBillEnum extends CommonEnum
8
+{
9
+    // 收支类型
10
+    const PM = [
11
+        'EXPEND' => ['code' => 0, 'name' => '支出'],
12
+        'INCOME' => ['code' => 1, 'name' => '获得'],
13
+    ];
14
+
15
+    // 状态
16
+    const STATUS = [
17
+        'PENDING' => ['code' => 0, 'name' => '待确定'],
18
+        'VALID' => ['code' => 1, 'name' => '有效'],
19
+        'INVALID' => ['code' => -1, 'name' => '无效'],
20
+    ];
21
+
22
+    // 佣金类型
23
+    const COMMISSION_TYPE = [
24
+        'AGENT_FEE' => ['code' => 1, 'name' => '代理费'],
25
+        'CONSUMPTION_COMMISSION' => ['code' => 2, 'name' => '消费佣金'],
26
+        'DIRECT_REFERRAL' => ['code' => 3, 'name' => '直推奖'],
27
+        'REGION_COMMISSION' => ['code' => 4, 'name' => '辖区佣金'],
28
+        'PENSION' => ['code' => 5, 'name' => '养老金'],
29
+        'AD_FEE' => ['code' => 6, 'name' => '广告费'],
30
+        'LOCKED_CUSTOMER' => ['code' => 7, 'name' => '锁客收益'],
31
+        'PLATFORM_REWARD' => ['code' => 8, 'name' => '平台奖励'],
32
+        'CHANNEL_DEALER' => ['code' => 9, 'name' => '渠道商'],
33
+        'SHOP_REWARD' => ['code' => 10, 'name' => '推广店铺收益'],
34
+        'PARTNER_DIVIDEND' => ['code' => 11, 'name' => '合伙人分红'],
35
+        'JOINT_CREATOR_DIVIDEND' => ['code' => 12, 'name' => '联创分红'],
36
+        'EQUITY_DIVIDEND' => ['code' => 13, 'name' => '股权分红'],
37
+        'SHARE_EARNINGS' => ['code' => 20, 'name' => '分享收益']
38
+    ];
39
+
40
+    // 账单来源
41
+    const SOURCE = [
42
+        'ONLINE' => ['code' => 0, 'name' => '线上'],
43
+        'OFFLINE' => ['code' => 1, 'name' => '线下'],
44
+    ];
45
+
46
+    // 订单类型
47
+    const ORDER_TYPE = [
48
+        'SELF_OPERATED' => ['code' => 1, 'name' => '自营'],
49
+        'THIRD_PARTY' => ['code' => 2, 'name' => '第三方'],
50
+    ];
51
+
52
+    // 红积分佣金类型
53
+    const IS_RED_BROKERAGE = [
54
+        'NORMAL' => ['code' => 0, 'name' => '正常佣金'],
55
+        'RED' => ['code' => 1, 'name' => '红积分对冲佣金'],
56
+    ];
57
+
58
+    // 公证处状态
59
+    const GZC_STATUS = [
60
+        'NOT_ENTERED' => ['code' => 0, 'name' => '未进入'],
61
+        'ENTERED' => ['code' => 1, 'name' => '已进入'],
62
+    ];
63
+
64
+    // 是否成功发起
65
+    const IS_GZC = [
66
+        'NOT_STARTED' => ['code' => 0, 'name' => '未发起'],
67
+        'STARTED' => ['code' => 1, 'name' => '已发起'],
68
+        'SUCCESS' => ['code' => 2, 'name' => '已成功'],
69
+    ];
70
+
71
+    // 类型商店
72
+    const TYPE_SHOP = parent::ORDER_TYPE;
73
+}

+ 38 - 0
app/common/enum/user/UserSignFugouEnum.php

@@ -0,0 +1,38 @@
1
+<?php
2
+
3
+namespace app\common\enum\user;
4
+
5
+use app\common\enum\CommonEnum;
6
+
7
+class UserSignFugouEnum extends CommonEnum
8
+{
9
+    // 1-有效 0-失效 -1待确认
10
+    const STATUS = [
11
+        'Valid' => ['code' => 1, 'name' => '有效'],
12
+        'Invalid' => ['code' => 0, 'name' => '失效'],
13
+        'Pending' => ['code' => -1, 'name' => '待确认'],
14
+    ];
15
+
16
+    // 1代理费 2 消费佣金 3直推奖 4辖区佣金 5养老金 6广告费 7锁客收益 8平台奖励 9渠道商 10推广店铺收益 11合伙人分红 12联创分红 13股权分红
17
+    const COMMISSION_TYPE = [
18
+        'AgentFee' => ['code' => 1, 'name' => '代理费'],
19
+        'ConsumeCommission' => ['code' => 2, 'name' => '消费佣金'],
20
+        'DirectPushReward' => ['code' => 3, 'name' => '直推奖'],
21
+        'AreaCommission' => ['code' => 4, 'name' => '辖区佣金'],
22
+        'Pension' => ['code' => 5, 'name' => '养老金'],
23
+        'AdFee' => ['code' => 6, 'name' => '广告费'],
24
+        'CustomerLockRevenue' => ['code' => 7, 'name' => '锁客收益'],
25
+        'PlatformReward' => ['code' => 8, 'name' => '平台奖励'],
26
+        'ChannelDistributor' => ['code' => 9, 'name' => '渠道商'],
27
+        'StorePromotionRevenue' => ['code' => 10, 'name' => '推广店铺收益'],
28
+        'PartnerDividend' => ['code' => 11, 'name' => '合伙人分红'],
29
+        'CoFounderDividend' => ['code' => 12, 'name' => '联创分红'],
30
+        'EquityDividend' => ['code' => 13, 'name' => '股权分红'],
31
+    ];
32
+
33
+    // 1赠送,2消耗
34
+    const TYPE = [
35
+        'Give' => ['code' => 1, 'name' => '赠送'],
36
+        'Consume' => ['code' => 2, 'name' => '消耗'],
37
+    ];
38
+}

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

@@ -0,0 +1,21 @@
1
+<?php
2
+
3
+namespace app\common\enum\user;
4
+
5
+use app\common\enum\CommonEnum;
6
+
7
+class UserSignJingdouEnum extends CommonEnum
8
+{
9
+    // 京豆状态
10
+    const STATUS = [
11
+        'Valid' => ['code' => 1, 'name' => '有效'],
12
+        'Invalid' => ['code' => 0, 'name' => '失效'],
13
+        'PendingConfirmation' => ['code' => -1, 'name' => '待确认'],
14
+    ];
15
+
16
+    // 京豆类型
17
+    const TYPE = [
18
+        'Gift' => ['code' => 1, 'name' => '赠送'],
19
+        'Consume' => ['code' => 2, 'name' => '消耗'],
20
+    ];
21
+}

+ 30 - 0
app/common/enum/user/UserSignScoreEnum.php

@@ -0,0 +1,30 @@
1
+<?php
2
+
3
+namespace app\common\enum\user;
4
+
5
+use app\common\enum\CommonEnum;
6
+
7
+class UserSignScoreEnum extends CommonEnum
8
+{
9
+    // 1-收入,2-支出
10
+    const PM = [
11
+        'Income' => ['code' => 1, 'name' => '收入'],
12
+        'Expend' => ['code' => 2, 'name' => '支出'],
13
+    ];
14
+
15
+    // 积分状态:1-有效,0-失效,-1-待确认
16
+    const STATUS = [
17
+        'Valid' => ['code' => 1, 'name' => '有效'],
18
+        'Invalid' => ['code' => 0, 'name' => '失效'],
19
+        'Pending' => ['code' => -1, 'name' => '待确认'],
20
+    ];
21
+
22
+    // 积分来源类型:1-签到,2-分享好友注册赠送,3-自己下单赠送,4-好友下单赠送,5-购买产品消耗
23
+    const SOURCE_TYPE = [
24
+        'SignIn' => ['code' => 1, 'name' => '签到'],
25
+        'ShareRegister' => ['code' => 2, 'name' => '分享好友注册赠送'],
26
+        'SelfOrder' => ['code' => 3, 'name' => '自己下单赠送'],
27
+        'FriendOrder' => ['code' => 4, 'name' => '好友下单赠送'],
28
+        'BuyProduct' => ['code' => 5, 'name' => '购买产品消耗'],
29
+    ];
30
+}

+ 14 - 0
app/common/enum/user/UserSignVrEnum.php

@@ -0,0 +1,14 @@
1
+<?php
2
+
3
+namespace app\common\enum\user;
4
+
5
+use app\common\enum\CommonEnum;
6
+
7
+class UserSignVrEnum extends CommonEnum
8
+{
9
+    // 1-兑换,2-消耗
10
+    const TYPE = [
11
+        'Exchange' => ['code' => 1, 'name' => '兑换'],
12
+        'Consume' => ['code' => 2, 'name' => '消耗'],
13
+    ];
14
+}

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

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace app\common\model\user;
4
+
5
+use app\common\model\BaseModel;
6
+
7
+class UserSignFugou 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_fugou';
18
+    }
19
+}

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

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace app\common\model\user;
4
+
5
+use app\common\model\BaseModel;
6
+
7
+class UserSignJingdou 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_jingdou';
18
+    }
19
+}

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

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace app\common\model\user;
4
+
5
+use app\common\model\BaseModel;
6
+
7
+class UserSignScore 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_score';
18
+    }
19
+}

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

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace app\common\model\user;
4
+
5
+use app\common\model\BaseModel;
6
+
7
+class UserSignVr 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_vr';
18
+    }
19
+}

+ 288 - 24
app/common/repositories/store/order/StoreOrderRepository.php

@@ -13,10 +13,16 @@ namespace app\common\repositories\store\order;
13 13
 
14 14
 use app\common\dao\store\order\StoreOrderDao;
15 15
 use app\common\enum\CommonEnum;
16
+use app\common\enum\merchant\MerchantEnum;
16 17
 use app\common\enum\shipping\ShippingTemplateEnum;
17 18
 use app\common\enum\store\CartEnum;
18 19
 use app\common\enum\store\ProductEnum;
20
+use app\common\enum\store\StoreGroupOrderEnum;
19 21
 use app\common\enum\store\StoreOrderEnum;
22
+use app\common\enum\user\UserBillEnum;
23
+use app\common\enum\user\UserSignJingdouEnum;
24
+use app\common\enum\user\UserSignScoreEnum;
25
+use app\common\enum\user\UserSignVrEnum;
20 26
 use app\common\model\store\order\StoreGroupOrder;
21 27
 use app\common\model\store\order\StoreOrder;
22 28
 use app\common\model\store\order\StoreRefundOrder;
@@ -57,6 +63,7 @@ use app\entity\data\store\CartEntity;
57 63
 use app\entity\data\store\StoreGroupOrderEntity;
58 64
 use app\entity\data\store\StoreOrderEntity;
59 65
 use app\entity\data\user\AddressEntity;
66
+use app\entity\data\user\UserBillEntity;
60 67
 use app\entity\data\user\UserEntity;
61 68
 use app\entity\monomer\store\FzonePayTypeEntity;
62 69
 use app\entity\request\api\store\order\StoreOrderCreateRequestEntity;
@@ -65,6 +72,7 @@ use app\model\common\TbOrderModel;
65 72
 use app\traits\GongApiRequest;
66 73
 use app\traits\HuiPay;
67 74
 use app\traits\ShouxinyiApiRequest;
75
+use app\utils\ArrayUtil;
68 76
 use Carbon\Carbon;
69 77
 use crmeb\jobs\PayGiveCouponJob;
70 78
 use crmeb\jobs\SendSmsJob;
@@ -10650,6 +10658,14 @@ class StoreOrderRepository extends BaseRepository
10650 10658
      */
10651 10659
     public function createOrderNew(StoreOrderCreateRequestEntity $storeOrderCreateRequestEntity, UserEntity $userEntity, array $cartEntityList, AddressEntity $addressEntity, ShareEntity $shareEntity)
10652 10660
     {
10661
+        // 参数处理
10662
+        $cartEntityList = array_combine(
10663
+            array_map(function ($cartEntity) {
10664
+                return $cartEntity->getCartId();
10665
+            }, $cartEntityList),
10666
+            $cartEntityList
10667
+        );
10668
+
10653 10669
         // 购物车
10654 10670
         /** @var StoreCartRepository $storeCartRepository */
10655 10671
         $storeCartRepository = app()->make(StoreCartRepository::class);
@@ -10692,13 +10708,19 @@ class StoreOrderRepository extends BaseRepository
10692 10708
         /** @var ShippingTemplateRegionRepository $shippingTemplateRegionRepository */
10693 10709
         $shippingTemplateRegionRepository = app()->make(ShippingTemplateRegionRepository::class);
10694 10710
 
10695
-        /** @var UserRepository $UserRepository */
10711
+        /** @var UserRepository $userRepository */
10696 10712
         $userRepository = app()->make(UserRepository::class);
10697 10713
         /** @var StoreOrderRepository $storeOrderRepository */
10698 10714
         $storeOrderRepository = app()->make(StoreOrderRepository::class);
10699 10715
         /** @var StoreGroupOrderRepository $storeGroupOrderRepository */
10700 10716
         $storeGroupOrderRepository = app()->make(StoreGroupOrderRepository::class);
10717
+        /** @var StoreOrderStatusRepository $storeOrderStatusRepository */
10718
+        $storeOrderStatusRepository = app()->make(StoreOrderStatusRepository::class);
10719
+        /** @var StoreOrderProductRepository $storeOrderProductRepository */
10720
+        $storeOrderProductRepository = app()->make(StoreOrderProductRepository::class);
10701 10721
 
10722
+        // 技术
10723
+        $num = 0;
10702 10724
         // 记录 用户 在指定商家的 优惠券
10703 10725
         $storeCouponUserEntityListByMerIdMap = [];
10704 10726
         // 当前优惠金额
@@ -10725,9 +10747,12 @@ class StoreOrderRepository extends BaseRepository
10725 10747
         $totalCost = 0.00;
10726 10748
         // 订单实体表
10727 10749
         $storeOrderEntityList = [];
10750
+        // 商品 信息
10751
+        $storeProductEntityMap = [];
10752
+        $storeProductAttrValueEntityMap = [];
10728 10753
 
10729 10754
         // 循环购物车 对购物车内的商品 进行条件验证 以及根据不同的商品 计算邮费
10730
-        foreach ($cartEntityList as $numKey => $cartEntity) {
10755
+        foreach ($cartEntityList as $cartId => $cartEntity) {
10731 10756
             // 验证商户
10732 10757
             $merchantEntity = $merchantRepository->getMerchantEntityByMerchantId($cartEntity->getMerId());
10733 10758
             if (empty($merchantEntity->getMerId())) {
@@ -10742,13 +10767,14 @@ class StoreOrderRepository extends BaseRepository
10742 10767
             if ($productEntity->getMerId() != $merchantEntity->getMerId()) {
10743 10768
                 throw new ValidateException('商家已下架该产品');
10744 10769
             }
10770
+            $storeProductEntityMap[$productEntity->getProductId()] = $productEntity;
10745 10771
 
10746 10772
             // 获取购物车商品属性信息
10747 10773
             $productAttrValueEntity = $productAttrValueRepository->getProductAttrValueEntityByUnique($cartEntity->getProductAttrUnique());
10748 10774
             if (empty($productAttrValueEntity->getProductId())) {
10749 10775
                 throw new ValidateException('未查询到商品属性信息');
10750 10776
             }
10751
-
10777
+            $storeProductAttrValueEntityMap[$cartEntity->getProductAttrUnique()] = $productAttrValueEntity;
10752 10778
             // 判断订单是否已失效
10753 10779
             if ($cartEntity->getIsFail() == CartEnum::IS_FAIL['Yes']['code']) {
10754 10780
                 throw new ValidateException($productEntity->getStoreName() . ' 已失效');
@@ -10954,7 +10980,7 @@ class StoreOrderRepository extends BaseRepository
10954 10980
             $storeOrderEntity->setCommissionRate((float)$merchantRepository->get($cartEntity->getMerId())->mer_commission_rate)
10955 10981
                 // 二级佣金 此字段已被用于分佣比例
10956 10982
                 ->setExtensionTwo($productAttrValueEntity->getExtensionTwo())
10957
-                ->setOrderSn($this->getNewOrderId() . ($numKey + 1))
10983
+                ->setOrderSn($this->getNewOrderId() . ($num++))
10958 10984
                 ->setUid($cartEntity->getUid())
10959 10985
                 ->setRealName($addressEntity->getRealName())
10960 10986
                 ->setUserPhone($addressEntity->getPhone())
@@ -10984,6 +11010,76 @@ class StoreOrderRepository extends BaseRepository
10984 11010
             $storeOrderEntityList[] = $storeOrderEntity;
10985 11011
         }
10986 11012
 
11013
+
11014
+        /** @var StoreGroupOrderEntity $storeGroupOrderEntity */
11015
+        $storeGroupOrderEntity = StoreGroupOrderEntity::newInstance();
11016
+        $storeGroupOrderEntity->setUid($userEntity->getUid())
11017
+            ->setGroupOrderSn($this->getNewOrderId() . '0')
11018
+            ->setTotalPostage($totalPostage)
11019
+            ->setTotalPrice($totalPrice)
11020
+            ->setTotalNum($totalNum)
11021
+            ->setRealName($addressEntity->getRealName())
11022
+            ->setUserPhone($addressEntity->getPhone())
11023
+            ->setUserAddress($addressEntity->getProvince() . $addressEntity->getCity() . $addressEntity->getDistrict() . $addressEntity->getDetail())
11024
+            ->setPayPrice($totalPrice)
11025
+            ->setPayPostage($totalPostage)
11026
+            ->setCost($totalCost)
11027
+            ->setPayType($storeOrderCreateRequestEntity->getPayType())
11028
+            ->setFzonePaytype($storeOrderCreateRequestEntity->getFzonePayType());
11029
+        $storeGroupOrderCreateResultModel = $storeGroupOrderRepository->create($storeGroupOrderEntity->toUnderlineArray());
11030
+        $storeGroupOrderEntity->setGroupOrderId($storeGroupOrderCreateResultModel->group_order_id);
11031
+
11032
+        $storeOrderStatusDataList = [];
11033
+        $storeOrderProductDataList = [];
11034
+        $storeOrderIdList = [];
11035
+        foreach ($storeOrderEntityList as $key => $storeOrderEntity) {
11036
+            // 获取当前 订单绑定的购物车
11037
+            $cartEntity = $cartEntityList[$storeOrderEntity->getCartId()];
11038
+
11039
+            // 将订单数据 写入数据库 并完善实体
11040
+            $storeOrderEntity->setGroupOrderId($storeGroupOrderEntity->getGroupOrderId());
11041
+            $storeOrderResultModel = $storeOrderRepository->create($storeOrderEntity->toUnderlineArray());
11042
+            $storeOrderEntity->setOrderId($storeOrderResultModel->order_id);
11043
+            $storeOrderEntityList[$key] = $storeOrderEntity;
11044
+            $storeOrderIdList[] = $storeOrderEntity->getOrderId();
11045
+
11046
+            // 将每件商品设计到的优惠券要取消掉
11047
+
11048
+            // 准备订单的 状态数据
11049
+            $storeOrderStatusDataList[] = [
11050
+                'order_id' => $storeOrderEntity->getOrderId(),
11051
+                'change_message' => '订单生成',
11052
+                'change_type' => 'create'
11053
+            ];
11054
+
11055
+            // 准备订单的
11056
+            $storeOrderProductDataList[] = [
11057
+                'order_id' => $storeOrderEntity->getOrderId(),
11058
+                'cart_id' => $storeOrderEntity->getCartId(),
11059
+                'uid' => $storeOrderEntity->getUid(),
11060
+                'product_id' => $cartEntity->getProductId(),
11061
+                'product_price' => $storeOrderEntity->getTotalPrice(),
11062
+                // 一级佣金
11063
+                'extension_one' => 0.00,
11064
+                // 二级佣金
11065
+                'extension_two' => 0.00,
11066
+                'product_sku' => $cartEntity->getProductAttrUnique(),
11067
+                'product_num' => $cartEntity->getCartNum(),
11068
+                'refund_num' => $cartEntity->getCartNum(),
11069
+                'type' => $storeProductEntityMap[$cartEntity->getProductId()]->getType(),
11070
+                'cart_info' => json_encode([
11071
+                    'product' => $storeProductEntityMap[$cartEntity->getProductId()]->toUnderlineArray(),
11072
+                    'productAttr' => $storeProductAttrValueEntityMap[$cartEntity->getProductAttrUnique()]->toUnderlineArray(),
11073
+                    'product_type' => $cartEntity->getProductType()
11074
+                ])
11075
+            ];
11076
+        }
11077
+
11078
+        $storeOrderStatusRepository->insertAll($storeOrderStatusDataList);
11079
+
11080
+        $storeOrderProductRepository->insertAll($storeOrderProductDataList);
11081
+
11082
+        $paySuccess = false;
10987 11083
         // 验证支付方式
10988 11084
         /** @var FzonePayTypeEntity $fzonePayTypeEntity */
10989 11085
         $fzonePayTypeEntity = FzonePayTypeEntity::newInstance($storeOrderCreateRequestEntity->getFzonePayType());
@@ -10991,64 +11087,232 @@ class StoreOrderRepository extends BaseRepository
10991 11087
             if ($fzonePayTypeEntity->getPrice() > $userEntity->getVr() || $fzonePayTypeEntity->getOther() > $userEntity->getScore()) {
10992 11088
                 throw new ValidateException('支付失败,VR或积分不足!');
10993 11089
             }
11090
+            // 修改用户的VR值 和 积分值
11091
+            // 修改用户VR
11092
+            $userRepository->updateUserVr(
11093
+                $userEntity->getUid(),
11094
+                UserSignVrEnum::TYPE['Consume']['code'],
11095
+                $fzonePayTypeEntity->getPrice(),
11096
+                '购买商品,订单编号:'.$storeGroupOrderEntity->getGroupOrderSn(),
11097
+                CommonEnum::ORDER_TYPE['Platform-Group']['code'],
11098
+                $storeGroupOrderEntity->getGroupOrderId()
11099
+            );
11100
+            // 修改用户积分
11101
+            $userRepository->updateUserScore(
11102
+                $userEntity->getUid(),
11103
+                UserSignScoreEnum::PM['Expend']['code'],
11104
+                $fzonePayTypeEntity->getOther(),
11105
+                '购买商品,订单编号:'.$storeGroupOrderEntity->getGroupOrderSn(),
11106
+                CommonEnum::ORDER_TYPE['Platform-Group']['code'],
11107
+                $storeGroupOrderEntity->getGroupOrderId()
11108
+            );
11109
+            $paySuccess = true;
10994 11110
         } else if ($fzonePayTypeEntity->getType() == StoreOrderEnum::FZONE_PAY_TYPE['B2-Cash+Score']['code']) {
10995 11111
             if ($fzonePayTypeEntity->getOther() > $userEntity->getScore()) {
10996 11112
                 throw new ValidateException('支付失败,积分不足!');
10997 11113
             }
11114
+            // 修改用户积分
11115
+            $userRepository->updateUserScore(
11116
+                $userEntity->getUid(),
11117
+                UserSignScoreEnum::PM['Expend']['code'],
11118
+                $fzonePayTypeEntity->getOther(),
11119
+                '购买商品,订单编号:'.$storeGroupOrderEntity->getGroupOrderSn(),
11120
+                CommonEnum::ORDER_TYPE['Platform-Group']['code'],
11121
+                $storeGroupOrderEntity->getGroupOrderId()
11122
+            );
10998 11123
         } else if ($fzonePayTypeEntity->getType() == StoreOrderEnum::FZONE_PAY_TYPE['B3-VR+Jingdou']['code']) {
10999 11124
             if ($fzonePayTypeEntity->getPrice() > $userEntity->getVr() || $fzonePayTypeEntity->getOther() > $userEntity->getJingdou()) {
11000 11125
                 throw new ValidateException('支付失败,VR或京豆不足!');
11001 11126
             }
11127
+            // 修改用户VR
11128
+            $userRepository->updateUserVr(
11129
+                $userEntity->getUid(),
11130
+                UserSignVrEnum::TYPE['Consume']['code'],
11131
+                $fzonePayTypeEntity->getPrice(),
11132
+                '购买商品,订单编号:'.$storeGroupOrderEntity->getGroupOrderSn(),
11133
+                CommonEnum::ORDER_TYPE['Platform-Group']['code'],
11134
+                $storeGroupOrderEntity->getGroupOrderId()
11135
+            );
11136
+            // 修改用户jingdou
11137
+            $userRepository->updateUserJingdou(
11138
+                $userEntity->getUid(),
11139
+                UserSignJingdouEnum::TYPE['Consume']['code'],
11140
+                $fzonePayTypeEntity->getOther(),
11141
+                '购买商品,订单编号:'.$storeGroupOrderEntity->getGroupOrderSn(),
11142
+                CommonEnum::ORDER_TYPE['Platform-Group']['code'],
11143
+                $storeGroupOrderEntity->getGroupOrderId()
11144
+            );
11145
+            $paySuccess = true;
11002 11146
         } else if ($fzonePayTypeEntity->getType() == StoreOrderEnum::FZONE_PAY_TYPE['B4-Cash+Jingdou']['code']) {
11003 11147
             if ($fzonePayTypeEntity->getPrice() > $userEntity->getVr() || $fzonePayTypeEntity->getOther() > $userEntity->getJingdou()) {
11004 11148
                 throw new ValidateException('支付失败,京豆不足!');
11005 11149
             }
11150
+            // 修改用户jingdou
11151
+            $userRepository->updateUserJingdou(
11152
+                $userEntity->getUid(),
11153
+                UserSignJingdouEnum::TYPE['Consume']['code'],
11154
+                $fzonePayTypeEntity->getOther(),
11155
+                '购买商品,订单编号:'.$storeGroupOrderEntity->getGroupOrderSn(),
11156
+                CommonEnum::ORDER_TYPE['Platform-Group']['code'],
11157
+                $storeGroupOrderEntity->getGroupOrderId()
11158
+            );
11006 11159
         } else if ($fzonePayTypeEntity->getType() == StoreOrderEnum::FZONE_PAY_TYPE['B5-VR']['code']) {
11007 11160
             if ($fzonePayTypeEntity->getPrice() > $userEntity->getVr()) {
11008 11161
                 throw new ValidateException('支付失败,VR不足!');
11009 11162
             }
11163
+            // 修改用户VR
11164
+            $userRepository->updateUserVr(
11165
+                $userEntity->getUid(),
11166
+                UserSignVrEnum::TYPE['Consume']['code'],
11167
+                $fzonePayTypeEntity->getPrice(),
11168
+                '购买商品,订单编号:'.$storeGroupOrderEntity->getGroupOrderSn(),
11169
+                CommonEnum::ORDER_TYPE['Platform-Group']['code'],
11170
+                $storeGroupOrderEntity->getGroupOrderId()
11171
+            );
11172
+            $paySuccess = true;
11010 11173
         } else if ($fzonePayTypeEntity->getType() == StoreOrderEnum::FZONE_PAY_TYPE['A1-VR']['code']) {
11011 11174
             if ($fzonePayTypeEntity->getPrice() > $userEntity->getVr()) {
11012 11175
                 throw new ValidateException('支付失败,VR不足!');
11013 11176
             }
11177
+            // 修改用户VR
11178
+            $userRepository->updateUserVr(
11179
+                $userEntity->getUid(),
11180
+                UserSignVrEnum::TYPE['Consume']['code'],
11181
+                $fzonePayTypeEntity->getPrice(),
11182
+                '购买商品,订单编号:'.$storeGroupOrderEntity->getGroupOrderSn(),
11183
+                CommonEnum::ORDER_TYPE['Platform-Group']['code'],
11184
+                $storeGroupOrderEntity->getGroupOrderId()
11185
+            );
11186
+            $paySuccess = true;
11014 11187
         } else if ($fzonePayTypeEntity->getType() == StoreOrderEnum::FZONE_PAY_TYPE['A2-Cash']['code']) {
11015 11188
 
11016 11189
         } else if ($fzonePayTypeEntity->getType() == StoreOrderEnum::FZONE_PAY_TYPE['A3-Cash+VR']['code']) {
11017 11190
             if ($fzonePayTypeEntity->getOther() > $userEntity->getVr()) {
11018 11191
                 throw new ValidateException('支付失败,VR不足!');
11019 11192
             }
11193
+            // 修改用户VR
11194
+            $userRepository->updateUserVr(
11195
+                $userEntity->getUid(),
11196
+                UserSignVrEnum::TYPE['Consume']['code'],
11197
+                $fzonePayTypeEntity->getOther(),
11198
+                '购买商品,订单编号:'.$storeGroupOrderEntity->getGroupOrderSn(),
11199
+                CommonEnum::ORDER_TYPE['Platform-Group']['code'],
11200
+                $storeGroupOrderEntity->getGroupOrderId()
11201
+            );
11020 11202
         } else if ($fzonePayTypeEntity->getType() == StoreOrderEnum::FZONE_PAY_TYPE['C1-Fugou']['code']) {
11021 11203
             if ($fzonePayTypeEntity->getOther() > $userEntity->getFugou()) {
11022 11204
                 throw new ValidateException('支付失败,复购金不足!');
11023 11205
             }
11206
+            // 修改用户复购金
11207
+            $userRepository->updateUserFugou(
11208
+                $userEntity->getUid(),
11209
+                UserSignVrEnum::TYPE['Consume']['code'],
11210
+                $fzonePayTypeEntity->getPrice(),
11211
+                '购买商品,订单编号:'.$storeGroupOrderEntity->getGroupOrderSn(),
11212
+                CommonEnum::ORDER_TYPE['Platform-Group']['code'],
11213
+                $storeGroupOrderEntity->getGroupOrderId()
11214
+            );
11215
+            $paySuccess = true;
11024 11216
         } else {
11025 11217
             throw new ValidateException('支付失败,支付方式错误!');
11026 11218
         }
11027 11219
 
11028
-        /** @var StoreGroupOrderEntity $storeGroupOrderEntity */
11029
-        $storeGroupOrderEntity = StoreGroupOrderEntity::newInstance();
11030
-        $storeGroupOrderEntity->setUid($userEntity->getUid())
11031
-            ->setGroupOrderSn($this->getNewOrderId() . '0')
11032
-            ->setTotalPostage($totalPostage)
11033
-            ->setTotalPrice($totalPrice)
11034
-            ->setTotalNum($totalNum)
11035
-            ->setRealName($addressEntity->getRealName())
11036
-            ->setUserPhone($addressEntity->getPhone())
11037
-            ->setUserAddress($addressEntity->getProvince() . $addressEntity->getCity() . $addressEntity->getDistrict() . $addressEntity->getDetail())
11038
-            ->setPayPrice($totalPrice)
11039
-            ->setPayPostage($totalPostage)
11040
-            ->setCost($totalCost)
11041
-            ->setPayType($storeOrderCreateRequestEntity->getPayType())
11042
-            ->setFzonePaytype($storeOrderCreateRequestEntity->getFzonePayType());
11043
-        $storeGroupOrderCreateResultModel = $storeGroupOrderRepository->create($storeGroupOrderEntity->toUnderlineArray());
11044
-        $storeGroupOrderEntity->setGroupOrderId($storeGroupOrderCreateResultModel->group_order_id);
11220
+        // 非涉及到现金 控件成功后 直接结算
11221
+        if ($paySuccess) {
11222
+            // 修改订单的 支付状态
11223
+            $storeGroupOrderRepository->update($storeGroupOrderEntity->getGroupOrderId(), [
11224
+                'paid' => StoreGroupOrderEnum::PAID['YES']['code'],
11225
+                'pay_time' => date('Y-m-d H:i:s')
11226
+            ]);
11227
+
11228
+            $storeOrderRepository->updates($storeOrderIdList, [
11229
+                'paid' => StoreOrderEnum::PAID['YES']['code'],
11230
+                'pay_time' => date('Y-m-d H:i:s'),
11231
+                'status' => StoreOrderEnum::STATUS['WAITING_SHIPMENT']['code'],
11232
+                'distribution_mode' => StoreOrderEnum::DISTRIBUTION_MODE['ExpressDelivery']
11233
+            ]);
11234
+
11235
+
11236
+            foreach ($storeOrderEntityList as $storeOrderEntity) {
11237
+                // 精彩生活区
11238
+                if ($storeOrderEntity->getMerId() == CommonEnum::DESIGN_MERCHANT_ID['WonderfulLiving']['code']) {
11239
+                    $ylj_pri = bcmul($storeOrderEntity->getConPri(), CommonEnum::YANGLAOJIN['Ratio']['code'], 2);
11045 11240
 
11046
-        foreach ($storeOrderEntityList as $storeOrderEntity) {
11047
-             $storeOrderEntity->setGroupOrderId($storeGroupOrderEntity->getGroupOrderId());
11048
-         }
11241
+                    $pv = bcmul($storeOrderEntity->getConPri(), CommonEnum::PV['Ratio']['code'], 2);
11049 11242
 
11050 11243
 
11244
+                }
11245
+            }
11246
+        }
11051 11247
 
11052 11248
         return [];
11053 11249
     }
11250
+
11251
+    /**
11252
+     * @param int $orderId
11253
+     * @return StoreOrderEntity
11254
+     */
11255
+    public function getStoreOrderEntityByOrderId(int $orderId): StoreOrderEntity
11256
+    {
11257
+        /** @var StoreOrderEntity $storeOrderEntity */
11258
+        $storeOrderEntity = $this->dao->getStoreOrderEntityByOrderId($orderId);
11259
+        return $storeOrderEntity;
11260
+    }
11261
+
11262
+    public function addGzcLog(int $uid, string $userName, string $mobile, string $userCard, float $pension, string $orderSn, int $payType, int $orderType)
11263
+    {
11264
+
11265
+    }
11266
+
11267
+    public function addUserBillLog(int $uid, int $typeShop, int $orderId, int $commissionType, float $number, string $mark, int $status = 0, int $gzc = 0)
11268
+    {
11269
+        /** @var UserRepository $userRepository */
11270
+        $userRepository = app()->make(UserRepository::class);
11271
+        $userEntity = $userRepository->getUserEntityByUid($uid);
11272
+        if (empty($userEntity->getUid())) {
11273
+            throw new ValidateException('未查询到用户信息');
11274
+        }
11275
+
11276
+        $orderSn = '';
11277
+        $merId = 0;
11278
+
11279
+        if ($typeShop == UserBillEnum::TYPE_SHOP['Platform']['code']) {
11280
+            /** @var StoreOrderRepository $storeOrderRepository */
11281
+            $storeOrderRepository = app()->make(StoreOrderRepository::class);
11282
+            $storeOrderEntity = $storeOrderRepository->getStoreOrderEntityByOrderId($orderId);
11283
+            if (empty($storeOrderEntity->getOrderId())) {
11284
+                throw new ValidateException('未查询到订单信息');
11285
+            }
11286
+            $orderId = $storeOrderEntity->getOrderId();
11287
+            $orderSn = $storeOrderEntity->getOrderSn();
11288
+            $merId = $storeOrderEntity->getMerId();
11289
+        }
11290
+
11291
+
11292
+        $takeTime = 0;
11293
+        if ($status == UserBillEnum::STATUS['VALID']['code']) {
11294
+            $takeTime = time();
11295
+        }
11296
+
11297
+        /** @var UserBillEntity $userBillEntity */
11298
+        $userBillEntity = UserBillEntity::newInstance();
11299
+        $userBillEntity->setUid($userEntity->getUid())
11300
+            ->setLinkId($orderId)
11301
+            ->setPm(UserBillEnum::PM['INCOME']['code'])
11302
+            ->setTitle(ArrayUtil::getEnumNameByCode($commissionType, UserBillEnum::COMMISSION_TYPE))
11303
+            ->setCategory('now_money')
11304
+            ->setType('commission')
11305
+            ->setNumber($number)
11306
+            ->setMark($mark)
11307
+            ->setStatus($status)
11308
+            ->setCommissionType($commissionType)
11309
+            ->setOrderSn($orderSn)
11310
+            ->setTypeShop($typeShop)
11311
+            ->setMerId($merId)
11312
+            ->setSource(UserBillEnum::SOURCE['ONLINE']['code'])
11313
+            ->setOrderType(UserBillEnum::ORDER_TYPE['SELF_OPERATED']['code'])
11314
+            ->setIsRedBrokerage(UserBillEnum::IS_RED_BROKERAGE['NORMAL']['code'])
11315
+            ->setGzc($gzc)
11316
+            ->setTakeTime($takeTime);
11317
+    }
11054 11318
 }

+ 200 - 0
app/common/repositories/user/UserRepository.php

@@ -15,6 +15,10 @@ use alipay\aop\AlipayConfig;
15 15
 use alipay\aop\AopCertClient;
16 16
 use app\common\dao\BaseDao;
17 17
 use app\common\dao\user\UserDao;
18
+use app\common\enum\user\UserSignFugouEnum;
19
+use app\common\enum\user\UserSignJingdouEnum;
20
+use app\common\enum\user\UserSignScoreEnum;
21
+use app\common\enum\user\UserSignVrEnum;
18 22
 use app\common\model\merchant\order\OrderMerchant;
19 23
 use app\common\model\user\User;
20 24
 use app\common\model\wechat\WechatUser;
@@ -27,6 +31,10 @@ use app\controller\api\store\product\Jd;
27 31
 use app\controller\api\store\product\Vip;
28 32
 use app\controller\api\user\Im;
29 33
 use app\entity\data\user\UserEntity;
34
+use app\entity\data\user\UserSignFugouEntity;
35
+use app\entity\data\user\UserSignJingdouEntity;
36
+use app\entity\data\user\UserSignScoreEntity;
37
+use app\entity\data\user\UserSignVrEntity;
30 38
 use app\traits\GzcApiRequest;
31 39
 use crmeb\exceptions\AuthException;
32 40
 use crmeb\jobs\SendNewPeopleCouponJob;
@@ -4393,4 +4401,196 @@ class UserRepository extends BaseRepository
4393 4401
         $userEntity = $this->dao->getUserEntityByUid($uid);
4394 4402
         return $userEntity;
4395 4403
     }
4404
+
4405
+    /**
4406
+     * 更新用户积分 并 写入积分变动记录
4407
+     * @param int $uid
4408
+     * @param int $type
4409
+     * @param float $score
4410
+     * @param string $mark
4411
+     * @param string $orderType
4412
+     * @param string $orderId
4413
+     * @return float
4414
+     */
4415
+    public function updateUserScore(int $uid, int $type, float $score, string $mark = '', string $orderType = '', string $orderId = ''): float
4416
+    {
4417
+        $userEntity = $this->getUserEntityByUid($uid);
4418
+        if (empty($userEntity->getUid())) {
4419
+            throw new ValidateException('未查询到用户信息');
4420
+        }
4421
+        if ($type == UserSignScoreEnum::PM['Expend']['code']) {
4422
+            $surplus = bcsub($userEntity->getScore(), $score, 2);
4423
+            if ($surplus < 0.00) {
4424
+                throw new ValidateException('用户积分不足');
4425
+            }
4426
+        } else {
4427
+            $surplus = bcadd($userEntity->getScore(), $score, 2);
4428
+        }
4429
+        try {
4430
+            $this->dao->update($uid, ['score' => $surplus]);
4431
+
4432
+            /** @var UserSignScoreEntity $userSignScoreEntity */
4433
+            $userSignScoreEntity = UserSignScoreEntity::newInstance();
4434
+            $userSignScoreEntity->setUid($uid)
4435
+                ->setPm($type)
4436
+                ->setRewardScore($score)
4437
+                ->setAddtime(time())
4438
+                ->setStatus(UserSignScoreEnum::STATUS['Valid']['code'])
4439
+                ->setOrderType($orderType)
4440
+                ->setOrderId($orderId)
4441
+                ->setMark($mark)
4442
+                ->setSurplus($surplus);
4443
+
4444
+            /** @var UserSignScoreRepository $userSignScoreRepository */
4445
+            $userSignScoreRepository = app()->make(UserSignScoreRepository::class);
4446
+            $userSignScoreRepository->create($userSignScoreEntity->toUnderlineArray());
4447
+        } catch (DbException $e) {
4448
+            throw new ValidateException('更新积分失败');
4449
+        }
4450
+        return (float)$surplus;
4451
+    }
4452
+
4453
+    /**
4454
+     * 更新用户Vr 并 写入Vr变动记录
4455
+     * @param int $uid
4456
+     * @param int $type
4457
+     * @param float $vr
4458
+     * @param string $mark
4459
+     * @param string $orderType
4460
+     * @param string $orderId
4461
+     * @return float
4462
+     */
4463
+    public function updateUserVr(int $uid, int $type, float $vr, string $mark = '', string $orderType = '', string $orderId = ''): float
4464
+    {
4465
+        $userEntity = $this->getUserEntityByUid($uid);
4466
+        if (empty($userEntity->getUid())) {
4467
+            throw new ValidateException('未查询到用户信息');
4468
+        }
4469
+        if ($type == UserSignVrEnum::TYPE['Consume']['code']) {
4470
+            $surplus = bcsub($userEntity->getVr(), $vr, 2);
4471
+            if ($surplus < 0.00) {
4472
+                throw new ValidateException('用户VR不足');
4473
+            }
4474
+        } else {
4475
+            $surplus = bcadd($userEntity->getVr(), $vr, 2);
4476
+        }
4477
+        try {
4478
+            $this->dao->update($uid, ['vr' => $surplus]);
4479
+
4480
+            /** @var UserSignVrEntity $userSignVrEntity */
4481
+            $userSignVrEntity = UserSignVrEntity::newInstance();
4482
+            $userSignVrEntity->setUid($uid)
4483
+                ->setType($type)
4484
+                ->setNumber($vr)
4485
+                ->setAddtime(time())
4486
+                ->setOrderType($orderType)
4487
+                ->setOrderId($orderId)
4488
+                ->setMark($mark)
4489
+                ->setSurplus($surplus);
4490
+
4491
+            /** @var UserSignVrRepository $userSignVrRepository */
4492
+            $userSignVrRepository = app()->make(UserSignVrRepository::class);
4493
+            $userSignVrRepository->create($userSignVrEntity->toUnderlineArray());
4494
+        } catch (DbException $e) {
4495
+            throw new ValidateException('更新VR失败');
4496
+        }
4497
+        return (float)$surplus;
4498
+    }
4499
+
4500
+    /**
4501
+     * 更新用户京豆 并 写入 京豆变动记录
4502
+     * @param int $uid
4503
+     * @param int $type
4504
+     * @param float $jingdou
4505
+     * @param string $mark
4506
+     * @param string $orderType
4507
+     * @param string $orderId
4508
+     * @param int $merId
4509
+     * @return float
4510
+     */
4511
+    public function updateUserJingdou(int $uid, int $type, float $jingdou, string $mark = '', string $orderType = '', string $orderId = '', int $merId = 0): float
4512
+    {
4513
+        $userEntity = $this->getUserEntityByUid($uid);
4514
+        if (empty($userEntity->getUid())) {
4515
+            throw new ValidateException('未查询到用户信息');
4516
+        }
4517
+        if ($type == UserSignJingdouEnum::TYPE['Consume']['code']) {
4518
+            $surplus = bcsub($userEntity->getJingdou(), $jingdou, 2);
4519
+            if ($surplus < 0.00) {
4520
+                throw new ValidateException('用户京豆不足');
4521
+            }
4522
+        } else {
4523
+            $surplus = bcadd($userEntity->getJingdou(), $jingdou, 2);
4524
+        }
4525
+        try {
4526
+            $this->dao->update($uid, ['jingdou' => $surplus]);
4527
+
4528
+            /** @var UserSignJingdouEntity $userSignJingdouEntity */
4529
+            $userSignJingdouEntity = UserSignJingdouEntity::newInstance();
4530
+            $userSignJingdouEntity->setUid($uid)
4531
+                ->setType($type)
4532
+                ->setStatus(UserSignJingdouEnum::STATUS['Valid']['code'])
4533
+                ->setNumber($jingdou)
4534
+                ->setAddtime(time())
4535
+                ->setOrderType($orderType)
4536
+                ->setOrderId($orderId)
4537
+                ->setMark($mark)
4538
+                ->setSurplus($surplus);
4539
+
4540
+            /** @var UserSignJingdouRepository $userSignJingdouRepository */
4541
+            $userSignJingdouRepository = app()->make(UserSignJingdouRepository::class);
4542
+            $userSignJingdouRepository->create($userSignJingdouEntity->toUnderlineArray());
4543
+        } catch (DbException $e) {
4544
+            throw new ValidateException('更新京豆失败');
4545
+        }
4546
+        return (float)$surplus;
4547
+    }
4548
+
4549
+    /**
4550
+     * 更新用户复购金 并 写入 复购金变动记录
4551
+     * @param int $uid
4552
+     * @param int $type
4553
+     * @param float $fugou
4554
+     * @param string $mark
4555
+     * @param string $orderType
4556
+     * @param string $orderId
4557
+     * @return float
4558
+     */
4559
+    public function updateUserFugou(int $uid, int $type, float $fugou, string $mark = '', string $orderType = '', string $orderId = ''): float
4560
+    {
4561
+        $userEntity = $this->getUserEntityByUid($uid);
4562
+        if (empty($userEntity->getUid())) {
4563
+            throw new ValidateException('未查询到用户信息');
4564
+        }
4565
+        if ($type == UserSignFugouEnum::TYPE['Consume']['code']) {
4566
+            $surplus = bcsub($userEntity->getFugou(), $fugou, 2);
4567
+            if ($surplus < 0.00) {
4568
+                throw new ValidateException('用户京豆不足');
4569
+            }
4570
+        } else {
4571
+            $surplus = bcadd($userEntity->getFugou(), $fugou, 2);
4572
+        }
4573
+        try {
4574
+            $this->dao->update($uid, ['fugou' => $surplus]);
4575
+
4576
+            /** @var UserSignFugouEntity $userSignFugouEntity */
4577
+            $userSignFugouEntity = UserSignFugouEntity::newInstance();
4578
+            $userSignFugouEntity->setUid($uid)
4579
+                ->setType($type)
4580
+                ->setStatus(UserSignFugouEnum::STATUS['Valid']['code'])
4581
+                ->setNumber($fugou)
4582
+                ->setAddtime(time())
4583
+                ->setOrderType($orderType)
4584
+                ->setOrderId($orderId)
4585
+                ->setMark($mark)
4586
+                ->setSurplus($surplus);
4587
+
4588
+            /** @var UserSignFugouRepository $userSignFugouRepository */
4589
+            $userSignFugouRepository = app()->make(UserSignFugouRepository::class);
4590
+            $userSignFugouRepository->create($userSignFugouEntity->toUnderlineArray());
4591
+        } catch (DbException $e) {
4592
+            throw new ValidateException('更新京豆失败');
4593
+        }
4594
+        return (float)$surplus;
4595
+    }
4396 4596
 }

+ 19 - 0
app/common/repositories/user/UserSignFugouRepository.php

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace app\common\repositories\user;
4
+
5
+use app\common\dao\user\UserSignFugouDao;
6
+use app\common\repositories\BaseRepository;
7
+
8
+class UserSignFugouRepository extends BaseRepository
9
+{
10
+    public function __construct(UserSignFugouDao $dao)
11
+    {
12
+        $this->dao = $dao;
13
+    }
14
+
15
+    public function create($data)
16
+    {
17
+        return $this->dao->create($data);
18
+    }
19
+}

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

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace app\common\repositories\user;
4
+
5
+use app\common\dao\user\UserSignJingdouDao;
6
+use app\common\repositories\BaseRepository;
7
+
8
+class UserSignJingdouRepository extends BaseRepository
9
+{
10
+    public function __construct(UserSignJingdouDao $dao)
11
+    {
12
+        $this->dao = $dao;
13
+    }
14
+
15
+    public function create($data)
16
+    {
17
+        return $this->dao->create($data);
18
+    }
19
+}

+ 19 - 0
app/common/repositories/user/UserSignScoreRepository.php

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace app\common\repositories\user;
4
+
5
+use app\common\dao\user\UserSignScoreDao;
6
+use app\common\repositories\BaseRepository;
7
+
8
+class UserSignScoreRepository extends BaseRepository
9
+{
10
+    public function __construct(UserSignScoreDao $dao)
11
+    {
12
+        $this->dao = $dao;
13
+    }
14
+
15
+    public function create($data)
16
+    {
17
+        return $this->dao->create($data);
18
+    }
19
+}

+ 19 - 0
app/common/repositories/user/UserSignVrRepository.php

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace app\common\repositories\user;
4
+
5
+use app\common\dao\user\UserSignVrDao;
6
+use app\common\repositories\BaseRepository;
7
+
8
+class UserSignVrRepository extends BaseRepository
9
+{
10
+    public function __construct(UserSignVrDao $dao)
11
+    {
12
+        $this->dao = $dao;
13
+    }
14
+
15
+    public function create($data)
16
+    {
17
+        return $this->dao->create($data);
18
+    }
19
+}

+ 523 - 0
app/entity/data/user/UserBillEntity.php

@@ -0,0 +1,523 @@
1
+<?php
2
+
3
+namespace app\entity\data\user;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class UserBillEntity extends DataEntity
8
+{
9
+    public $billId = 0;  // 用户账单id
10
+    public $uid = 0;  // 用户uid
11
+    public $linkId = 0;  // 关联订单id
12
+    public $pm = 0;  // 收支类型 0 = 支出 1 = 获得
13
+    public $title = '';  // 账单标题
14
+    public $category = '';  // 明细种类
15
+    public $type = '';  // 明细类型
16
+    public $number = 0.00;  // 明细数字
17
+    public $balance = 0.00;  // 剩余
18
+    public $mark = '';  // 备注
19
+    public $createTime = '';  // 添加时间
20
+    public $status = 1;  // 状态 0 = 待确定 1 = 有效 -1 = 无效
21
+    public $commissionType = 0;  // 佣金类型
22
+    public $orderSn = '';  // 订单号
23
+    public $tripartite = 0;  // 第三方类型
24
+    public $typeShop = 0;  // 类型商店 0平台1多多进宝2唯品会3苏宁易购4网易考拉5淘宝客6京东联盟7饿了么8线上9话费
25
+    public $merId = 0;  // 商户id
26
+    public $source = 0;  // 账单来源 1 线下 0线上
27
+    public $orderType = 1;  // 订单类型 1自营  2 第三方
28
+    public $isRedBrokerage = 0;  // 红积分对冲佣金类型 0正常佣金 1红积分对冲佣金
29
+    public $gzc = 0;  // 公证处状态 0:未进入 1:已进入
30
+    public $isGzc = 0;  // 是否成功发起 0:未发起 1:已发起 2:已成功
31
+    public $takeTime = 0;  // 结算时间
32
+    public $districtId = 0;  // 区域id
33
+    public $streetId = 0;  // 街道id
34
+    public $month = '';  // 月份
35
+    public $num = 1;  // 份数
36
+
37
+    /**
38
+     * @return int
39
+     */
40
+    public function getBillId(): int
41
+    {
42
+        return $this->billId;
43
+    }
44
+
45
+    /**
46
+     * @param int $billId
47
+     * @return UserBillEntity
48
+     */
49
+    public function setBillId(int $billId): UserBillEntity
50
+    {
51
+        $this->billId = $billId;
52
+        return $this;
53
+    }
54
+
55
+    /**
56
+     * @return int
57
+     */
58
+    public function getUid(): int
59
+    {
60
+        return $this->uid;
61
+    }
62
+
63
+    /**
64
+     * @param int $uid
65
+     * @return UserBillEntity
66
+     */
67
+    public function setUid(int $uid): UserBillEntity
68
+    {
69
+        $this->uid = $uid;
70
+        return $this;
71
+    }
72
+
73
+    /**
74
+     * @return int
75
+     */
76
+    public function getLinkId(): int
77
+    {
78
+        return $this->linkId;
79
+    }
80
+
81
+    /**
82
+     * @param int $linkId
83
+     * @return UserBillEntity
84
+     */
85
+    public function setLinkId(int $linkId): UserBillEntity
86
+    {
87
+        $this->linkId = $linkId;
88
+        return $this;
89
+    }
90
+
91
+    /**
92
+     * @return int
93
+     */
94
+    public function getPm(): int
95
+    {
96
+        return $this->pm;
97
+    }
98
+
99
+    /**
100
+     * @param int $pm
101
+     * @return UserBillEntity
102
+     */
103
+    public function setPm(int $pm): UserBillEntity
104
+    {
105
+        $this->pm = $pm;
106
+        return $this;
107
+    }
108
+
109
+    /**
110
+     * @return string
111
+     */
112
+    public function getTitle(): string
113
+    {
114
+        return $this->title;
115
+    }
116
+
117
+    /**
118
+     * @param string $title
119
+     * @return UserBillEntity
120
+     */
121
+    public function setTitle(string $title): UserBillEntity
122
+    {
123
+        $this->title = $title;
124
+        return $this;
125
+    }
126
+
127
+    /**
128
+     * @return string
129
+     */
130
+    public function getCategory(): string
131
+    {
132
+        return $this->category;
133
+    }
134
+
135
+    /**
136
+     * @param string $category
137
+     * @return UserBillEntity
138
+     */
139
+    public function setCategory(string $category): UserBillEntity
140
+    {
141
+        $this->category = $category;
142
+        return $this;
143
+    }
144
+
145
+    /**
146
+     * @return string
147
+     */
148
+    public function getType(): string
149
+    {
150
+        return $this->type;
151
+    }
152
+
153
+    /**
154
+     * @param string $type
155
+     * @return UserBillEntity
156
+     */
157
+    public function setType(string $type): UserBillEntity
158
+    {
159
+        $this->type = $type;
160
+        return $this;
161
+    }
162
+
163
+    /**
164
+     * @return float
165
+     */
166
+    public function getNumber(): float
167
+    {
168
+        return $this->number;
169
+    }
170
+
171
+    /**
172
+     * @param float $number
173
+     * @return UserBillEntity
174
+     */
175
+    public function setNumber(float $number): UserBillEntity
176
+    {
177
+        $this->number = $number;
178
+        return $this;
179
+    }
180
+
181
+    /**
182
+     * @return float
183
+     */
184
+    public function getBalance(): float
185
+    {
186
+        return $this->balance;
187
+    }
188
+
189
+    /**
190
+     * @param float $balance
191
+     * @return UserBillEntity
192
+     */
193
+    public function setBalance(float $balance): UserBillEntity
194
+    {
195
+        $this->balance = $balance;
196
+        return $this;
197
+    }
198
+
199
+    /**
200
+     * @return string
201
+     */
202
+    public function getMark(): string
203
+    {
204
+        return $this->mark;
205
+    }
206
+
207
+    /**
208
+     * @param string $mark
209
+     * @return UserBillEntity
210
+     */
211
+    public function setMark(string $mark): UserBillEntity
212
+    {
213
+        $this->mark = $mark;
214
+        return $this;
215
+    }
216
+
217
+    /**
218
+     * @return string
219
+     */
220
+    public function getCreateTime(): string
221
+    {
222
+        return $this->createTime;
223
+    }
224
+
225
+    /**
226
+     * @param string $createTime
227
+     * @return UserBillEntity
228
+     */
229
+    public function setCreateTime(string $createTime): UserBillEntity
230
+    {
231
+        $this->createTime = $createTime;
232
+        return $this;
233
+    }
234
+
235
+    /**
236
+     * @return int
237
+     */
238
+    public function getStatus(): int
239
+    {
240
+        return $this->status;
241
+    }
242
+
243
+    /**
244
+     * @param int $status
245
+     * @return UserBillEntity
246
+     */
247
+    public function setStatus(int $status): UserBillEntity
248
+    {
249
+        $this->status = $status;
250
+        return $this;
251
+    }
252
+
253
+    /**
254
+     * @return int
255
+     */
256
+    public function getCommissionType(): int
257
+    {
258
+        return $this->commissionType;
259
+    }
260
+
261
+    /**
262
+     * @param int $commissionType
263
+     * @return UserBillEntity
264
+     */
265
+    public function setCommissionType(int $commissionType): UserBillEntity
266
+    {
267
+        $this->commissionType = $commissionType;
268
+        return $this;
269
+    }
270
+
271
+    /**
272
+     * @return string
273
+     */
274
+    public function getOrderSn(): string
275
+    {
276
+        return $this->orderSn;
277
+    }
278
+
279
+    /**
280
+     * @param string $orderSn
281
+     * @return UserBillEntity
282
+     */
283
+    public function setOrderSn(string $orderSn): UserBillEntity
284
+    {
285
+        $this->orderSn = $orderSn;
286
+        return $this;
287
+    }
288
+
289
+    /**
290
+     * @return int
291
+     */
292
+    public function getTripartite(): int
293
+    {
294
+        return $this->tripartite;
295
+    }
296
+
297
+    /**
298
+     * @param int $tripartite
299
+     * @return UserBillEntity
300
+     */
301
+    public function setTripartite(int $tripartite): UserBillEntity
302
+    {
303
+        $this->tripartite = $tripartite;
304
+        return $this;
305
+    }
306
+
307
+    /**
308
+     * @return int
309
+     */
310
+    public function getTypeShop(): int
311
+    {
312
+        return $this->typeShop;
313
+    }
314
+
315
+    /**
316
+     * @param int $typeShop
317
+     * @return UserBillEntity
318
+     */
319
+    public function setTypeShop(int $typeShop): UserBillEntity
320
+    {
321
+        $this->typeShop = $typeShop;
322
+        return $this;
323
+    }
324
+
325
+    /**
326
+     * @return int
327
+     */
328
+    public function getMerId(): int
329
+    {
330
+        return $this->merId;
331
+    }
332
+
333
+    /**
334
+     * @param int $merId
335
+     * @return UserBillEntity
336
+     */
337
+    public function setMerId(int $merId): UserBillEntity
338
+    {
339
+        $this->merId = $merId;
340
+        return $this;
341
+    }
342
+
343
+    /**
344
+     * @return int
345
+     */
346
+    public function getSource(): int
347
+    {
348
+        return $this->source;
349
+    }
350
+
351
+    /**
352
+     * @param int $source
353
+     * @return UserBillEntity
354
+     */
355
+    public function setSource(int $source): UserBillEntity
356
+    {
357
+        $this->source = $source;
358
+        return $this;
359
+    }
360
+
361
+    /**
362
+     * @return int
363
+     */
364
+    public function getOrderType(): int
365
+    {
366
+        return $this->orderType;
367
+    }
368
+
369
+    /**
370
+     * @param int $orderType
371
+     * @return UserBillEntity
372
+     */
373
+    public function setOrderType(int $orderType): UserBillEntity
374
+    {
375
+        $this->orderType = $orderType;
376
+        return $this;
377
+    }
378
+
379
+    /**
380
+     * @return int
381
+     */
382
+    public function getIsRedBrokerage(): int
383
+    {
384
+        return $this->isRedBrokerage;
385
+    }
386
+
387
+    /**
388
+     * @param int $isRedBrokerage
389
+     * @return UserBillEntity
390
+     */
391
+    public function setIsRedBrokerage(int $isRedBrokerage): UserBillEntity
392
+    {
393
+        $this->isRedBrokerage = $isRedBrokerage;
394
+        return $this;
395
+    }
396
+
397
+    /**
398
+     * @return int
399
+     */
400
+    public function getGzc(): int
401
+    {
402
+        return $this->gzc;
403
+    }
404
+
405
+    /**
406
+     * @param int $gzc
407
+     * @return UserBillEntity
408
+     */
409
+    public function setGzc(int $gzc): UserBillEntity
410
+    {
411
+        $this->gzc = $gzc;
412
+        return $this;
413
+    }
414
+
415
+    /**
416
+     * @return int
417
+     */
418
+    public function getIsGzc(): int
419
+    {
420
+        return $this->isGzc;
421
+    }
422
+
423
+    /**
424
+     * @param int $isGzc
425
+     * @return UserBillEntity
426
+     */
427
+    public function setIsGzc(int $isGzc): UserBillEntity
428
+    {
429
+        $this->isGzc = $isGzc;
430
+        return $this;
431
+    }
432
+
433
+    /**
434
+     * @return int
435
+     */
436
+    public function getTakeTime(): int
437
+    {
438
+        return $this->takeTime;
439
+    }
440
+
441
+    /**
442
+     * @param int $takeTime
443
+     * @return UserBillEntity
444
+     */
445
+    public function setTakeTime(int $takeTime): UserBillEntity
446
+    {
447
+        $this->takeTime = $takeTime;
448
+        return $this;
449
+    }
450
+
451
+    /**
452
+     * @return int
453
+     */
454
+    public function getDistrictId(): int
455
+    {
456
+        return $this->districtId;
457
+    }
458
+
459
+    /**
460
+     * @param int $districtId
461
+     * @return UserBillEntity
462
+     */
463
+    public function setDistrictId(int $districtId): UserBillEntity
464
+    {
465
+        $this->districtId = $districtId;
466
+        return $this;
467
+    }
468
+
469
+    /**
470
+     * @return int
471
+     */
472
+    public function getStreetId(): int
473
+    {
474
+        return $this->streetId;
475
+    }
476
+
477
+    /**
478
+     * @param int $streetId
479
+     * @return UserBillEntity
480
+     */
481
+    public function setStreetId(int $streetId): UserBillEntity
482
+    {
483
+        $this->streetId = $streetId;
484
+        return $this;
485
+    }
486
+
487
+    /**
488
+     * @return string
489
+     */
490
+    public function getMonth(): string
491
+    {
492
+        return $this->month;
493
+    }
494
+
495
+    /**
496
+     * @param string $month
497
+     * @return UserBillEntity
498
+     */
499
+    public function setMonth(string $month): UserBillEntity
500
+    {
501
+        $this->month = $month;
502
+        return $this;
503
+    }
504
+
505
+    /**
506
+     * @return int
507
+     */
508
+    public function getNum(): int
509
+    {
510
+        return $this->num;
511
+    }
512
+
513
+    /**
514
+     * @param int $num
515
+     * @return UserBillEntity
516
+     */
517
+    public function setNum(int $num): UserBillEntity
518
+    {
519
+        $this->num = $num;
520
+        return $this;
521
+    }
522
+
523
+}

+ 256 - 0
app/entity/data/user/UserSignFugouEntity.php

@@ -0,0 +1,256 @@
1
+<?php
2
+
3
+namespace app\entity\data\user;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class UserSignFugouEntity 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 $surplus = 0.00;  // 剩余
17
+    public $orderType = '';  // 订单类型。关联订单ID
18
+    public $commissionType = 0;  // 佣金类型:1代理费 2 消费佣金 3直推奖 4辖区佣金 5养老金 6广告费 7锁客收益 8平台奖励 9渠道商 10推广店铺收益 11合伙人分红 12联创分红 13股权分红
19
+    public $type = null;  // 复购金类型:1赠送,2消耗
20
+    public $settlementTime = null;  // 结算时间
21
+    public $addtime = 0;  // 添加时间
22
+
23
+    /**
24
+     * @return int
25
+     */
26
+    public function getId(): int
27
+    {
28
+        return $this->id;
29
+    }
30
+
31
+    /**
32
+     * @param int $id
33
+     * @return UserSignFugouEntity
34
+     */
35
+    public function setId(int $id): UserSignFugouEntity
36
+    {
37
+        $this->id = $id;
38
+        return $this;
39
+    }
40
+
41
+    /**
42
+     * @return int
43
+     */
44
+    public function getUid(): int
45
+    {
46
+        return $this->uid;
47
+    }
48
+
49
+    /**
50
+     * @param int $uid
51
+     * @return UserSignFugouEntity
52
+     */
53
+    public function setUid(int $uid): UserSignFugouEntity
54
+    {
55
+        $this->uid = $uid;
56
+        return $this;
57
+    }
58
+
59
+    /**
60
+     * @return float
61
+     */
62
+    public function getNumber(): float
63
+    {
64
+        return $this->number;
65
+    }
66
+
67
+    /**
68
+     * @param float $number
69
+     * @return UserSignFugouEntity
70
+     */
71
+    public function setNumber(float $number): UserSignFugouEntity
72
+    {
73
+        $this->number = $number;
74
+        return $this;
75
+    }
76
+
77
+    /**
78
+     * @return int
79
+     */
80
+    public function getStatus(): int
81
+    {
82
+        return $this->status;
83
+    }
84
+
85
+    /**
86
+     * @param int $status
87
+     * @return UserSignFugouEntity
88
+     */
89
+    public function setStatus(int $status): UserSignFugouEntity
90
+    {
91
+        $this->status = $status;
92
+        return $this;
93
+    }
94
+
95
+    /**
96
+     * @return string
97
+     */
98
+    public function getMark(): string
99
+    {
100
+        return $this->mark;
101
+    }
102
+
103
+    /**
104
+     * @param string $mark
105
+     * @return UserSignFugouEntity
106
+     */
107
+    public function setMark(string $mark): UserSignFugouEntity
108
+    {
109
+        $this->mark = $mark;
110
+        return $this;
111
+    }
112
+
113
+    /**
114
+     * @return string
115
+     */
116
+    public function getDesc(): string
117
+    {
118
+        return $this->desc;
119
+    }
120
+
121
+    /**
122
+     * @param string $desc
123
+     * @return UserSignFugouEntity
124
+     */
125
+    public function setDesc(string $desc): UserSignFugouEntity
126
+    {
127
+        $this->desc = $desc;
128
+        return $this;
129
+    }
130
+
131
+    /**
132
+     * @return string
133
+     */
134
+    public function getOrderId(): string
135
+    {
136
+        return $this->orderId;
137
+    }
138
+
139
+    /**
140
+     * @param string $orderId
141
+     * @return UserSignFugouEntity
142
+     */
143
+    public function setOrderId(string $orderId): UserSignFugouEntity
144
+    {
145
+        $this->orderId = $orderId;
146
+        return $this;
147
+    }
148
+
149
+    /**
150
+     * @return float
151
+     */
152
+    public function getSurplus(): float
153
+    {
154
+        return $this->surplus;
155
+    }
156
+
157
+    /**
158
+     * @param float $surplus
159
+     * @return UserSignFugouEntity
160
+     */
161
+    public function setSurplus(float $surplus): UserSignFugouEntity
162
+    {
163
+        $this->surplus = $surplus;
164
+        return $this;
165
+    }
166
+
167
+    /**
168
+     * @return string
169
+     */
170
+    public function getOrderType(): string
171
+    {
172
+        return $this->orderType;
173
+    }
174
+
175
+    /**
176
+     * @param string $orderType
177
+     * @return UserSignFugouEntity
178
+     */
179
+    public function setOrderType(string $orderType): UserSignFugouEntity
180
+    {
181
+        $this->orderType = $orderType;
182
+        return $this;
183
+    }
184
+
185
+    /**
186
+     * @return int
187
+     */
188
+    public function getCommissionType(): int
189
+    {
190
+        return $this->commissionType;
191
+    }
192
+
193
+    /**
194
+     * @param int $commissionType
195
+     * @return UserSignFugouEntity
196
+     */
197
+    public function setCommissionType(int $commissionType): UserSignFugouEntity
198
+    {
199
+        $this->commissionType = $commissionType;
200
+        return $this;
201
+    }
202
+
203
+    /**
204
+     * @return null
205
+     */
206
+    public function getType()
207
+    {
208
+        return $this->type;
209
+    }
210
+
211
+    /**
212
+     * @param null $type
213
+     * @return UserSignFugouEntity
214
+     */
215
+    public function setType($type)
216
+    {
217
+        $this->type = $type;
218
+        return $this;
219
+    }
220
+
221
+    /**
222
+     * @return null
223
+     */
224
+    public function getSettlementTime()
225
+    {
226
+        return $this->settlementTime;
227
+    }
228
+
229
+    /**
230
+     * @param null $settlementTime
231
+     * @return UserSignFugouEntity
232
+     */
233
+    public function setSettlementTime($settlementTime)
234
+    {
235
+        $this->settlementTime = $settlementTime;
236
+        return $this;
237
+    }
238
+
239
+    /**
240
+     * @return int
241
+     */
242
+    public function getAddtime(): int
243
+    {
244
+        return $this->addtime;
245
+    }
246
+
247
+    /**
248
+     * @param int $addtime
249
+     * @return UserSignFugouEntity
250
+     */
251
+    public function setAddtime(int $addtime): UserSignFugouEntity
252
+    {
253
+        $this->addtime = $addtime;
254
+        return $this;
255
+    }
256
+}

+ 256 - 0
app/entity/data/user/UserSignJingdouEntity.php

@@ -0,0 +1,256 @@
1
+<?php
2
+
3
+namespace app\entity\data\user;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class UserSignJingdouEntity extends DataEntity
8
+{
9
+    public $id = 0;  // 自增id
10
+    public $uid = 0;  // 会员id
11
+    public $merId = 0;  // 商户id
12
+    public $number = 0.00;  // 赠送数量
13
+    public $status = 0;  // 京豆状态:1-有效 0-失效 -1待确认
14
+    public $mark = '';  // 备注
15
+    public $desc = '';  // 描述
16
+    public $orderId = '';  // 订单id
17
+    public $surplus = 0.00;  // 剩余
18
+    public $orderType = '';  // 订单类型。关联订单ID
19
+    public $type = null;  // 京豆类型:1赠送,2消耗
20
+    public $settlementTime = null;  // 结算时间
21
+    public $addtime = 0;  // 添加时间
22
+
23
+    /**
24
+     * @return int
25
+     */
26
+    public function getId(): int
27
+    {
28
+        return $this->id;
29
+    }
30
+
31
+    /**
32
+     * @param int $id
33
+     * @return UserSignJingdouEntity
34
+     */
35
+    public function setId(int $id): UserSignJingdouEntity
36
+    {
37
+        $this->id = $id;
38
+        return $this;
39
+    }
40
+
41
+    /**
42
+     * @return int
43
+     */
44
+    public function getUid(): int
45
+    {
46
+        return $this->uid;
47
+    }
48
+
49
+    /**
50
+     * @param int $uid
51
+     * @return UserSignJingdouEntity
52
+     */
53
+    public function setUid(int $uid): UserSignJingdouEntity
54
+    {
55
+        $this->uid = $uid;
56
+        return $this;
57
+    }
58
+
59
+    /**
60
+     * @return int
61
+     */
62
+    public function getMerId(): int
63
+    {
64
+        return $this->merId;
65
+    }
66
+
67
+    /**
68
+     * @param int $merId
69
+     * @return UserSignJingdouEntity
70
+     */
71
+    public function setMerId(int $merId): UserSignJingdouEntity
72
+    {
73
+        $this->merId = $merId;
74
+        return $this;
75
+    }
76
+
77
+    /**
78
+     * @return float
79
+     */
80
+    public function getNumber(): float
81
+    {
82
+        return $this->number;
83
+    }
84
+
85
+    /**
86
+     * @param float $number
87
+     * @return UserSignJingdouEntity
88
+     */
89
+    public function setNumber(float $number): UserSignJingdouEntity
90
+    {
91
+        $this->number = $number;
92
+        return $this;
93
+    }
94
+
95
+    /**
96
+     * @return int
97
+     */
98
+    public function getStatus(): int
99
+    {
100
+        return $this->status;
101
+    }
102
+
103
+    /**
104
+     * @param int $status
105
+     * @return UserSignJingdouEntity
106
+     */
107
+    public function setStatus(int $status): UserSignJingdouEntity
108
+    {
109
+        $this->status = $status;
110
+        return $this;
111
+    }
112
+
113
+    /**
114
+     * @return string
115
+     */
116
+    public function getMark(): string
117
+    {
118
+        return $this->mark;
119
+    }
120
+
121
+    /**
122
+     * @param string $mark
123
+     * @return UserSignJingdouEntity
124
+     */
125
+    public function setMark(string $mark): UserSignJingdouEntity
126
+    {
127
+        $this->mark = $mark;
128
+        return $this;
129
+    }
130
+
131
+    /**
132
+     * @return string
133
+     */
134
+    public function getDesc(): string
135
+    {
136
+        return $this->desc;
137
+    }
138
+
139
+    /**
140
+     * @param string $desc
141
+     * @return UserSignJingdouEntity
142
+     */
143
+    public function setDesc(string $desc): UserSignJingdouEntity
144
+    {
145
+        $this->desc = $desc;
146
+        return $this;
147
+    }
148
+
149
+    /**
150
+     * @return string
151
+     */
152
+    public function getOrderId(): string
153
+    {
154
+        return $this->orderId;
155
+    }
156
+
157
+    /**
158
+     * @param string $orderId
159
+     * @return UserSignJingdouEntity
160
+     */
161
+    public function setOrderId(string $orderId): UserSignJingdouEntity
162
+    {
163
+        $this->orderId = $orderId;
164
+        return $this;
165
+    }
166
+
167
+    /**
168
+     * @return float
169
+     */
170
+    public function getSurplus(): float
171
+    {
172
+        return $this->surplus;
173
+    }
174
+
175
+    /**
176
+     * @param float $surplus
177
+     * @return UserSignJingdouEntity
178
+     */
179
+    public function setSurplus(float $surplus): UserSignJingdouEntity
180
+    {
181
+        $this->surplus = $surplus;
182
+        return $this;
183
+    }
184
+
185
+    /**
186
+     * @return string
187
+     */
188
+    public function getOrderType(): string
189
+    {
190
+        return $this->orderType;
191
+    }
192
+
193
+    /**
194
+     * @param string $orderType
195
+     * @return UserSignJingdouEntity
196
+     */
197
+    public function setOrderType(string $orderType): UserSignJingdouEntity
198
+    {
199
+        $this->orderType = $orderType;
200
+        return $this;
201
+    }
202
+
203
+    /**
204
+     * @return null
205
+     */
206
+    public function getType()
207
+    {
208
+        return $this->type;
209
+    }
210
+
211
+    /**
212
+     * @param null $type
213
+     * @return UserSignJingdouEntity
214
+     */
215
+    public function setType($type)
216
+    {
217
+        $this->type = $type;
218
+        return $this;
219
+    }
220
+
221
+    /**
222
+     * @return null
223
+     */
224
+    public function getSettlementTime()
225
+    {
226
+        return $this->settlementTime;
227
+    }
228
+
229
+    /**
230
+     * @param null $settlementTime
231
+     * @return UserSignJingdouEntity
232
+     */
233
+    public function setSettlementTime($settlementTime)
234
+    {
235
+        $this->settlementTime = $settlementTime;
236
+        return $this;
237
+    }
238
+
239
+    /**
240
+     * @return int
241
+     */
242
+    public function getAddtime(): int
243
+    {
244
+        return $this->addtime;
245
+    }
246
+
247
+    /**
248
+     * @param int $addtime
249
+     * @return UserSignJingdouEntity
250
+     */
251
+    public function setAddtime(int $addtime): UserSignJingdouEntity
252
+    {
253
+        $this->addtime = $addtime;
254
+        return $this;
255
+    }
256
+}

+ 294 - 0
app/entity/data/user/UserSignScoreEntity.php

@@ -0,0 +1,294 @@
1
+<?php
2
+
3
+namespace app\entity\data\user;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class UserSignScoreEntity extends DataEntity
8
+{
9
+    public $id = 0;  // 自增id
10
+    public $uid = 0;  // 会员id
11
+    public $continuityDay = 0;  // 连续签到几天
12
+    public $rewardScore = 0.00;  // 赠送积分数量
13
+    public $signinTime = 0;  // 签到时间
14
+    public $sourceUid = 0;  // 赠送积分来源用户id
15
+    public $status = 0;  // 积分状态:1-有效,0-失效,-1待确认
16
+    public $mark = '';  // 备注
17
+    public $orderId = '';  // 订单id
18
+    public $pm = 1;  // 1-收入,2-支出
19
+    public $surplus = 0.00;  // 剩余
20
+    public $orderType = '';  // 订单类型,关联订单ID
21
+    public $addtime = 0;  // 添加时间
22
+    public $sourceType = 1;  // 积分来源类型:1签到,2分享好友注册赠送,3自己下单赠送,4好友下单赠送,5购买产品消耗
23
+    public $settlementTime = 0;  // 结算时间
24
+
25
+    /**
26
+     * @return int
27
+     */
28
+    public function getId(): int
29
+    {
30
+        return $this->id;
31
+    }
32
+
33
+    /**
34
+     * @param int $id
35
+     * @return UserSignScoreEntity
36
+     */
37
+    public function setId(int $id): UserSignScoreEntity
38
+    {
39
+        $this->id = $id;
40
+        return $this;
41
+    }
42
+
43
+    /**
44
+     * @return int
45
+     */
46
+    public function getUid(): int
47
+    {
48
+        return $this->uid;
49
+    }
50
+
51
+    /**
52
+     * @param int $uid
53
+     * @return UserSignScoreEntity
54
+     */
55
+    public function setUid(int $uid): UserSignScoreEntity
56
+    {
57
+        $this->uid = $uid;
58
+        return $this;
59
+    }
60
+
61
+    /**
62
+     * @return int
63
+     */
64
+    public function getContinuityDay(): int
65
+    {
66
+        return $this->continuityDay;
67
+    }
68
+
69
+    /**
70
+     * @param int $continuityDay
71
+     * @return UserSignScoreEntity
72
+     */
73
+    public function setContinuityDay(int $continuityDay): UserSignScoreEntity
74
+    {
75
+        $this->continuityDay = $continuityDay;
76
+        return $this;
77
+    }
78
+
79
+    /**
80
+     * @return float
81
+     */
82
+    public function getRewardScore(): float
83
+    {
84
+        return $this->rewardScore;
85
+    }
86
+
87
+    /**
88
+     * @param float $rewardScore
89
+     * @return UserSignScoreEntity
90
+     */
91
+    public function setRewardScore(float $rewardScore): UserSignScoreEntity
92
+    {
93
+        $this->rewardScore = $rewardScore;
94
+        return $this;
95
+    }
96
+
97
+    /**
98
+     * @return int
99
+     */
100
+    public function getSigninTime(): int
101
+    {
102
+        return $this->signinTime;
103
+    }
104
+
105
+    /**
106
+     * @param int $signinTime
107
+     * @return UserSignScoreEntity
108
+     */
109
+    public function setSigninTime(int $signinTime): UserSignScoreEntity
110
+    {
111
+        $this->signinTime = $signinTime;
112
+        return $this;
113
+    }
114
+
115
+    /**
116
+     * @return int
117
+     */
118
+    public function getSourceUid(): int
119
+    {
120
+        return $this->sourceUid;
121
+    }
122
+
123
+    /**
124
+     * @param int $sourceUid
125
+     * @return UserSignScoreEntity
126
+     */
127
+    public function setSourceUid(int $sourceUid): UserSignScoreEntity
128
+    {
129
+        $this->sourceUid = $sourceUid;
130
+        return $this;
131
+    }
132
+
133
+    /**
134
+     * @return int
135
+     */
136
+    public function getStatus(): int
137
+    {
138
+        return $this->status;
139
+    }
140
+
141
+    /**
142
+     * @param int $status
143
+     * @return UserSignScoreEntity
144
+     */
145
+    public function setStatus(int $status): UserSignScoreEntity
146
+    {
147
+        $this->status = $status;
148
+        return $this;
149
+    }
150
+
151
+    /**
152
+     * @return string
153
+     */
154
+    public function getMark(): string
155
+    {
156
+        return $this->mark;
157
+    }
158
+
159
+    /**
160
+     * @param string $mark
161
+     * @return UserSignScoreEntity
162
+     */
163
+    public function setMark(string $mark): UserSignScoreEntity
164
+    {
165
+        $this->mark = $mark;
166
+        return $this;
167
+    }
168
+
169
+    /**
170
+     * @return string
171
+     */
172
+    public function getOrderId(): string
173
+    {
174
+        return $this->orderId;
175
+    }
176
+
177
+    /**
178
+     * @param string $orderId
179
+     * @return UserSignScoreEntity
180
+     */
181
+    public function setOrderId(string $orderId): UserSignScoreEntity
182
+    {
183
+        $this->orderId = $orderId;
184
+        return $this;
185
+    }
186
+
187
+    /**
188
+     * @return int
189
+     */
190
+    public function getPm(): int
191
+    {
192
+        return $this->pm;
193
+    }
194
+
195
+    /**
196
+     * @param int $pm
197
+     * @return UserSignScoreEntity
198
+     */
199
+    public function setPm(int $pm): UserSignScoreEntity
200
+    {
201
+        $this->pm = $pm;
202
+        return $this;
203
+    }
204
+
205
+    /**
206
+     * @return float
207
+     */
208
+    public function getSurplus(): float
209
+    {
210
+        return $this->surplus;
211
+    }
212
+
213
+    /**
214
+     * @param float $surplus
215
+     * @return UserSignScoreEntity
216
+     */
217
+    public function setSurplus(float $surplus): UserSignScoreEntity
218
+    {
219
+        $this->surplus = $surplus;
220
+        return $this;
221
+    }
222
+
223
+    /**
224
+     * @return string
225
+     */
226
+    public function getOrderType(): string
227
+    {
228
+        return $this->orderType;
229
+    }
230
+
231
+    /**
232
+     * @param string $orderType
233
+     * @return UserSignScoreEntity
234
+     */
235
+    public function setOrderType(string $orderType): UserSignScoreEntity
236
+    {
237
+        $this->orderType = $orderType;
238
+        return $this;
239
+    }
240
+
241
+    /**
242
+     * @return int
243
+     */
244
+    public function getAddtime(): int
245
+    {
246
+        return $this->addtime;
247
+    }
248
+
249
+    /**
250
+     * @param int $addtime
251
+     * @return UserSignScoreEntity
252
+     */
253
+    public function setAddtime(int $addtime): UserSignScoreEntity
254
+    {
255
+        $this->addtime = $addtime;
256
+        return $this;
257
+    }
258
+
259
+    /**
260
+     * @return int
261
+     */
262
+    public function getSourceType(): int
263
+    {
264
+        return $this->sourceType;
265
+    }
266
+
267
+    /**
268
+     * @param int $sourceType
269
+     * @return UserSignScoreEntity
270
+     */
271
+    public function setSourceType(int $sourceType): UserSignScoreEntity
272
+    {
273
+        $this->sourceType = $sourceType;
274
+        return $this;
275
+    }
276
+
277
+    /**
278
+     * @return int
279
+     */
280
+    public function getSettlementTime(): int
281
+    {
282
+        return $this->settlementTime;
283
+    }
284
+
285
+    /**
286
+     * @param int $settlementTime
287
+     * @return UserSignScoreEntity
288
+     */
289
+    public function setSettlementTime(int $settlementTime): UserSignScoreEntity
290
+    {
291
+        $this->settlementTime = $settlementTime;
292
+        return $this;
293
+    }
294
+}

+ 218 - 0
app/entity/data/user/UserSignVrEntity.php

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

+ 16 - 0
app/utils/ArrayUtil.php

@@ -27,4 +27,20 @@ class ArrayUtil
27 27
         }
28 28
         return $result;
29 29
     }
30
+
31
+    /**
32
+     * 根据 code 获取 name
33
+     * @param $code
34
+     * @param array $data
35
+     * @return mixed|null
36
+     */
37
+    public static function getEnumNameByCode($code, array $data = [])
38
+    {
39
+        foreach ($data as $datum) {
40
+            if (isset($datum['code']) && isset($datum['name']) && $datum['code'] === $code) {
41
+                return $datum['name'];
42
+            }
43
+        }
44
+        return null;
45
+    }
30 46
 }