Kaynağa Gözat

共富体系-初始化

sunxbiao 6 ay önce
ebeveyn
işleme
b02667f258

+ 15 - 0
app/common/dao/shared/SharedProsperityRecommendConfigDao.php

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

+ 15 - 0
app/common/dao/shared/SharedProsperityUserDao.php

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

+ 18 - 0
app/common/model/shared/SharedProsperityRecommendConfig.php

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

+ 18 - 0
app/common/model/shared/SharedProsperityUser.php

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

+ 39 - 0
app/common/repositories/shared/SharedProsperityRecommendConfigRepository.php

@@ -0,0 +1,39 @@
1
+<?php
2
+
3
+namespace app\common\repositories\shared;
4
+
5
+use app\common\dao\shared\SharedProsperityRecommendConfigDao;
6
+use app\common\repositories\BaseRepository;
7
+use app\entity\data\shared\SharedProsperityRecommendConfigEntity;
8
+
9
+class SharedProsperityRecommendConfigRepository extends BaseRepository
10
+{
11
+
12
+    protected $dao;
13
+
14
+    /**
15
+     * SharedProsperityUserRepository constructor.
16
+     * @param SharedProsperityRecommendConfigDao $dao
17
+     */
18
+    public function __construct(SharedProsperityRecommendConfigDao $dao)
19
+    {
20
+        $this->dao = $dao;
21
+    }
22
+
23
+    public function create($data)
24
+    {
25
+        return $this->dao->create($data);
26
+    }
27
+
28
+    /**
29
+     * @param SharedProsperityRecommendConfigEntity $sharedProsperityRecommendConfigEntity
30
+     * @return SharedProsperityRecommendConfigEntity
31
+     */
32
+    public function createByEntity(SharedProsperityRecommendConfigEntity $sharedProsperityRecommendConfigEntity): SharedProsperityRecommendConfigEntity
33
+    {
34
+        $result = $this->create($sharedProsperityRecommendConfigEntity->toUnderlineArray())->toArray();
35
+        /** @var SharedProsperityRecommendConfigEntity $entity */
36
+        $entity = SharedProsperityRecommendConfigEntity::newInstance($result);
37
+        return $entity;
38
+    }
39
+}

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

@@ -0,0 +1,39 @@
1
+<?php
2
+
3
+namespace app\common\repositories\shared;
4
+
5
+use app\common\dao\shared\SharedProsperityUserDao;
6
+use app\common\repositories\BaseRepository;
7
+use app\entity\data\shared\SharedProsperityUserEntity;
8
+
9
+class SharedProsperityUserRepository extends BaseRepository
10
+{
11
+
12
+    protected $dao;
13
+
14
+    /**
15
+     * SharedProsperityUserRepository constructor.
16
+     * @param SharedProsperityUserDao $dao
17
+     */
18
+    public function __construct(SharedProsperityUserDao $dao)
19
+    {
20
+        $this->dao = $dao;
21
+    }
22
+
23
+    public function create($data)
24
+    {
25
+        return $this->dao->create($data);
26
+    }
27
+
28
+    /**
29
+     * @param SharedProsperityUserEntity $sharedProsperityUserEntity
30
+     * @return SharedProsperityUserEntity
31
+     */
32
+    public function createByEntity(SharedProsperityUserEntity $sharedProsperityUserEntity): SharedProsperityUserEntity
33
+    {
34
+        $result = $this->create($sharedProsperityUserEntity->toUnderlineArray())->toArray();
35
+        /** @var SharedProsperityUserEntity $entity */
36
+        $entity = SharedProsperityUserEntity::newInstance($result);
37
+        return $entity;
38
+    }
39
+}

+ 142 - 0
app/entity/data/shared/SharedProsperityRecommendConfigEntity.php

@@ -0,0 +1,142 @@
1
+<?php
2
+
3
+namespace app\entity\data\shared;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class SharedProsperityRecommendConfigEntity extends DataEntity
8
+{
9
+    public $id = null;  // 主键
10
+    public $level = null;  // 等级
11
+    public $name = null;  // 描述
12
+    public $rewardRatio = null;  // 推荐奖励占比
13
+    public $pv = null;  // 业绩
14
+    public $createTime = null;  // 创建时间
15
+    public $updateTime = null;  // 更新时间
16
+
17
+    /**
18
+     * @return mixed
19
+     */
20
+    public function getId()
21
+    {
22
+        return $this->id;
23
+    }
24
+
25
+    /**
26
+     * @param mixed $id
27
+     * @return SharedProsperityRecommendConfigEntity
28
+     */
29
+    public function setId($id): SharedProsperityRecommendConfigEntity
30
+    {
31
+        $this->id = $id;
32
+        return $this;
33
+    }
34
+
35
+    /**
36
+     * @return mixed
37
+     */
38
+    public function getLevel()
39
+    {
40
+        return $this->level;
41
+    }
42
+
43
+    /**
44
+     * @param mixed $level
45
+     * @return SharedProsperityRecommendConfigEntity
46
+     */
47
+    public function setLevel($level): SharedProsperityRecommendConfigEntity
48
+    {
49
+        $this->level = $level;
50
+        return $this;
51
+    }
52
+
53
+    /**
54
+     * @return mixed
55
+     */
56
+    public function getName()
57
+    {
58
+        return $this->name;
59
+    }
60
+
61
+    /**
62
+     * @param mixed $name
63
+     * @return SharedProsperityRecommendConfigEntity
64
+     */
65
+    public function setName($name): SharedProsperityRecommendConfigEntity
66
+    {
67
+        $this->name = $name;
68
+        return $this;
69
+    }
70
+
71
+    /**
72
+     * @return mixed
73
+     */
74
+    public function getRewardRatio()
75
+    {
76
+        return $this->rewardRatio;
77
+    }
78
+
79
+    /**
80
+     * @param mixed $rewardRatio
81
+     * @return SharedProsperityRecommendConfigEntity
82
+     */
83
+    public function setRewardRatio($rewardRatio): SharedProsperityRecommendConfigEntity
84
+    {
85
+        $this->rewardRatio = $rewardRatio;
86
+        return $this;
87
+    }
88
+
89
+    /**
90
+     * @return mixed
91
+     */
92
+    public function getPv()
93
+    {
94
+        return $this->pv;
95
+    }
96
+
97
+    /**
98
+     * @param mixed $pv
99
+     * @return SharedProsperityRecommendConfigEntity
100
+     */
101
+    public function setPv($pv): SharedProsperityRecommendConfigEntity
102
+    {
103
+        $this->pv = $pv;
104
+        return $this;
105
+    }
106
+
107
+    /**
108
+     * @return mixed
109
+     */
110
+    public function getCreateTime()
111
+    {
112
+        return $this->createTime;
113
+    }
114
+
115
+    /**
116
+     * @param mixed $createTime
117
+     * @return SharedProsperityRecommendConfigEntity
118
+     */
119
+    public function setCreateTime($createTime): SharedProsperityRecommendConfigEntity
120
+    {
121
+        $this->createTime = $createTime;
122
+        return $this;
123
+    }
124
+
125
+    /**
126
+     * @return mixed
127
+     */
128
+    public function getUpdateTime()
129
+    {
130
+        return $this->updateTime;
131
+    }
132
+
133
+    /**
134
+     * @param mixed $updateTime
135
+     * @return SharedProsperityRecommendConfigEntity
136
+     */
137
+    public function setUpdateTime($updateTime): SharedProsperityRecommendConfigEntity
138
+    {
139
+        $this->updateTime = $updateTime;
140
+        return $this;
141
+    }
142
+}

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

@@ -0,0 +1,180 @@
1
+<?php
2
+
3
+namespace app\entity\data\shared;
4
+
5
+use app\entity\data\DataEntity;
6
+
7
+class SharedProsperityUserEntity extends DataEntity
8
+{
9
+    public $id = null;  // 主键
10
+    public $userId = null;  // 用户id
11
+    public $parentId = null;  // 推荐人用户id
12
+    public $pv = null;  // pv
13
+    public $teamPv = null;  // 团队pv
14
+    public $withdrawalLimit = null;  // 提现额度
15
+    public $partnerLevel = null;  // 合伙人等级
16
+    public $createTime = null;  // 创建时间
17
+    public $updateTime = null;  // 更新时间
18
+
19
+    /**
20
+     * @return mixed
21
+     */
22
+    public function getId()
23
+    {
24
+        return $this->id;
25
+    }
26
+
27
+    /**
28
+     * @param mixed $id
29
+     * @return SharedProsperityUserEntity
30
+     */
31
+    public function setId($id): SharedProsperityUserEntity
32
+    {
33
+        $this->id = $id;
34
+        return $this;
35
+    }
36
+
37
+    /**
38
+     * @return mixed
39
+     */
40
+    public function getUserId()
41
+    {
42
+        return $this->userId;
43
+    }
44
+
45
+    /**
46
+     * @param mixed $userId
47
+     * @return SharedProsperityUserEntity
48
+     */
49
+    public function setUserId($userId): SharedProsperityUserEntity
50
+    {
51
+        $this->userId = $userId;
52
+        return $this;
53
+    }
54
+
55
+    /**
56
+     * @return mixed
57
+     */
58
+    public function getParentId()
59
+    {
60
+        return $this->parentId;
61
+    }
62
+
63
+    /**
64
+     * @param mixed $parentId
65
+     * @return SharedProsperityUserEntity
66
+     */
67
+    public function setParentId($parentId): SharedProsperityUserEntity
68
+    {
69
+        $this->parentId = $parentId;
70
+        return $this;
71
+    }
72
+
73
+    /**
74
+     * @return mixed
75
+     */
76
+    public function getPv()
77
+    {
78
+        return $this->pv;
79
+    }
80
+
81
+    /**
82
+     * @param mixed $pv
83
+     * @return SharedProsperityUserEntity
84
+     */
85
+    public function setPv($pv): SharedProsperityUserEntity
86
+    {
87
+        $this->pv = $pv;
88
+        return $this;
89
+    }
90
+
91
+    /**
92
+     * @return mixed
93
+     */
94
+    public function getTeamPv()
95
+    {
96
+        return $this->teamPv;
97
+    }
98
+
99
+    /**
100
+     * @param mixed $teamPv
101
+     * @return SharedProsperityUserEntity
102
+     */
103
+    public function setTeamPv($teamPv): SharedProsperityUserEntity
104
+    {
105
+        $this->teamPv = $teamPv;
106
+        return $this;
107
+    }
108
+
109
+    /**
110
+     * @return mixed
111
+     */
112
+    public function getWithdrawalLimit()
113
+    {
114
+        return $this->withdrawalLimit;
115
+    }
116
+
117
+    /**
118
+     * @param mixed $withdrawalLimit
119
+     * @return SharedProsperityUserEntity
120
+     */
121
+    public function setWithdrawalLimit($withdrawalLimit): SharedProsperityUserEntity
122
+    {
123
+        $this->withdrawalLimit = $withdrawalLimit;
124
+        return $this;
125
+    }
126
+
127
+    /**
128
+     * @return mixed
129
+     */
130
+    public function getPartnerLevel()
131
+    {
132
+        return $this->partnerLevel;
133
+    }
134
+
135
+    /**
136
+     * @param mixed $partnerLevel
137
+     * @return SharedProsperityUserEntity
138
+     */
139
+    public function setPartnerLevel($partnerLevel): SharedProsperityUserEntity
140
+    {
141
+        $this->partnerLevel = $partnerLevel;
142
+        return $this;
143
+    }
144
+
145
+    /**
146
+     * @return mixed
147
+     */
148
+    public function getCreateTime()
149
+    {
150
+        return $this->createTime;
151
+    }
152
+
153
+    /**
154
+     * @param mixed $createTime
155
+     * @return SharedProsperityUserEntity
156
+     */
157
+    public function setCreateTime($createTime): SharedProsperityUserEntity
158
+    {
159
+        $this->createTime = $createTime;
160
+        return $this;
161
+    }
162
+
163
+    /**
164
+     * @return mixed
165
+     */
166
+    public function getUpdateTime()
167
+    {
168
+        return $this->updateTime;
169
+    }
170
+
171
+    /**
172
+     * @param mixed $updateTime
173
+     * @return SharedProsperityUserEntity
174
+     */
175
+    public function setUpdateTime($updateTime): SharedProsperityUserEntity
176
+    {
177
+        $this->updateTime = $updateTime;
178
+        return $this;
179
+    }
180
+}