hk-cdp 1.0.105__py3-none-any.whl → 1.0.107__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hk_cdp/libs/customize/asset_base_model.py +18 -1
- hk_cdp/models/db_models/tt/tt_source_history_member_model.py +2 -2
- {hk_cdp-1.0.105.dist-info → hk_cdp-1.0.107.dist-info}/METADATA +1 -1
- {hk_cdp-1.0.105.dist-info → hk_cdp-1.0.107.dist-info}/RECORD +7 -7
- {hk_cdp-1.0.105.dist-info → hk_cdp-1.0.107.dist-info}/LICENSE +0 -0
- {hk_cdp-1.0.105.dist-info → hk_cdp-1.0.107.dist-info}/WHEEL +0 -0
- {hk_cdp-1.0.105.dist-info → hk_cdp-1.0.107.dist-info}/top_level.txt +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"""
|
|
3
3
|
:Author: HuangJianYi
|
|
4
4
|
:Date: 2020-05-12 20:11:48
|
|
5
|
-
@LastEditTime: 2025-
|
|
5
|
+
@LastEditTime: 2025-08-05 15:53:24
|
|
6
6
|
@LastEditors: HuangJianYi
|
|
7
7
|
:description:
|
|
8
8
|
"""
|
|
@@ -215,9 +215,26 @@ class AssetBaseModel():
|
|
|
215
215
|
member_asset_log.valid_type = 1
|
|
216
216
|
member_asset_log.create_date = now_datetime
|
|
217
217
|
|
|
218
|
+
update_asset_log_list = []
|
|
219
|
+
if operate_type in [1, 3]: # 只有消费和作废需要,更新剩余值
|
|
220
|
+
asset_log_list = member_asset_log_model.get_list(where="one_id=%s AND asset_type=1 AND operate_type=0 AND surplus_value>0", params=[one_id], order_by="valid_end_date ASC,create_date ASC")
|
|
221
|
+
operate_value = asset_value
|
|
222
|
+
for asset_log in asset_log_list:
|
|
223
|
+
if asset_log.surplus_value >= operate_value:
|
|
224
|
+
asset_log.history_value = asset_log.surplus_value # 历史值为当前剩余值
|
|
225
|
+
asset_log.surplus_value -= operate_value # 剩余值减少
|
|
226
|
+
update_asset_log_list.append(asset_log)
|
|
227
|
+
break
|
|
228
|
+
else:
|
|
229
|
+
asset_log.history_value = asset_log.surplus_value # 历史值为当前剩余值
|
|
230
|
+
operate_value -= asset_log.surplus_value # 操作值减少
|
|
231
|
+
asset_log.surplus_value = 0 # 剩余值为0
|
|
232
|
+
update_asset_log_list.append(asset_log)
|
|
218
233
|
|
|
219
234
|
# 开始事务
|
|
220
235
|
db_transaction.begin_transaction()
|
|
236
|
+
if update_asset_log_list:
|
|
237
|
+
member_asset_log_model.update_list(update_asset_log_list, field_list='history_value,surplus_value')
|
|
221
238
|
|
|
222
239
|
if old_user_asset_id != 0:
|
|
223
240
|
member_asset_model.update_entity(member_asset, "asset_value,asset_check_code,modify_date,total_incr_value,total_decr_value")
|
|
@@ -29,7 +29,7 @@ class TtSourceHistoryMember:
|
|
|
29
29
|
self.union_id = "" # union_id
|
|
30
30
|
self.store_id = "" # 店铺id
|
|
31
31
|
self.current_points = "" # 积分余额
|
|
32
|
-
self.
|
|
32
|
+
self.level_id = 0 # 等级
|
|
33
33
|
self.mobile = "" # 明文手机号
|
|
34
34
|
self.mask_mobile = "" # 掩码手机号
|
|
35
35
|
self.apply_time = '1900-01-01 00:00:00.000' # 入会时间
|
|
@@ -41,7 +41,7 @@ class TtSourceHistoryMember:
|
|
|
41
41
|
@classmethod
|
|
42
42
|
def get_field_list(self):
|
|
43
43
|
return [
|
|
44
|
-
'doudian_open_id', 'union_id', 'store_id', 'current_points', '
|
|
44
|
+
'doudian_open_id', 'union_id', 'store_id', 'current_points', 'level_id', 'mobile', 'mask_mobile',
|
|
45
45
|
'apply_time', 'order_total_amount', 'order_count', 'modify_time', 'create_time'
|
|
46
46
|
]
|
|
47
47
|
|
|
@@ -3,7 +3,7 @@ hk_cdp/handler/__init__.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
|
|
|
3
3
|
hk_cdp/handler/cdp_base.py,sha256=CgLnJPuxRzpfIZvxk9-7Tu1qfcsFm-xKLYkOaWw9gp0,2605
|
|
4
4
|
hk_cdp/libs/__init__.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
|
|
5
5
|
hk_cdp/libs/customize/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
hk_cdp/libs/customize/asset_base_model.py,sha256=
|
|
6
|
+
hk_cdp/libs/customize/asset_base_model.py,sha256=eRExBgVfURH2YYElDCEJwarhG0yAw0aLGyuZZTqYiaI,24862
|
|
7
7
|
hk_cdp/libs/customize/cdp_helper.py,sha256=st4NOYbFBT4WIOJ3j7bcAyml503z2ayiU78hbrNisGM,11810
|
|
8
8
|
hk_cdp/libs/customize/rainbow_helper.py,sha256=M9gb3MyHf8SHGtX27GC8llivvAZxV_fb1CqJK_crfZ4,2372
|
|
9
9
|
hk_cdp/libs/customize/tiktok_spi_helper.py,sha256=CBzZOZlwcJdI22HOewIPTvAPWOHYdyvq7OAZhijTlFA,3575
|
|
@@ -61,13 +61,13 @@ hk_cdp/models/db_models/tt/tt_rds_item_model.py,sha256=WCgZIo1lBgR1VWfS-8SALXWcI
|
|
|
61
61
|
hk_cdp/models/db_models/tt/tt_rds_refund_model.py,sha256=y51lwWDHHLIrNw-YjIKTm3EuS3PbWcIl-ZE_S9LYCBE,1987
|
|
62
62
|
hk_cdp/models/db_models/tt/tt_rds_trade_model.py,sha256=BBc0uHI7VDRWRcCGZHniWtkk3-ToDr6hKGhQwEiryvY,1948
|
|
63
63
|
hk_cdp/models/db_models/tt/tt_source_buyer_model.py,sha256=xftM1m2DMIQVyw6y1vJgNlVqqL63k8iMgdLpg5GiI9w,1779
|
|
64
|
-
hk_cdp/models/db_models/tt/tt_source_history_member_model.py,sha256=
|
|
64
|
+
hk_cdp/models/db_models/tt/tt_source_history_member_model.py,sha256=Z7DeqNWTfnGEMvaa2WGJhc4hZ-r6PzfTUsqgjswWf6A,2086
|
|
65
65
|
hk_cdp/models/db_models/user/__init__.py,sha256=O_F1_TiR_075ATAHcahxTKJwUdYeY-QzJqzO0EbsaCM,68
|
|
66
66
|
hk_cdp/models/db_models/user/user_data_model.py,sha256=hswh3ELJtBilEgzr7W6MfmaWsnSr93oO0nizbbPeRAk,2757
|
|
67
67
|
hk_cdp/models/db_models/user/user_info_model.py,sha256=TywpvlFGkch9hO_szyhin-ed4xfTWBM7L59IU96SfxU,4138
|
|
68
68
|
hk_cdp/models/db_models/user/user_trends_model.py,sha256=oxJCBnJQEvFr1_heV_cxRrPIic6_oSoLqARc6ldp2LM,1592
|
|
69
|
-
hk_cdp-1.0.
|
|
70
|
-
hk_cdp-1.0.
|
|
71
|
-
hk_cdp-1.0.
|
|
72
|
-
hk_cdp-1.0.
|
|
73
|
-
hk_cdp-1.0.
|
|
69
|
+
hk_cdp-1.0.107.dist-info/LICENSE,sha256=hKHSuDoDoyOk6vOrpkYnOXZ640PvhUa-BTQbRRtFsUk,1061
|
|
70
|
+
hk_cdp-1.0.107.dist-info/METADATA,sha256=9b-C1SesIfXAtGNPo2D92W-9rhdnUI-uDxVgm2Mza7A,7102
|
|
71
|
+
hk_cdp-1.0.107.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
|
|
72
|
+
hk_cdp-1.0.107.dist-info/top_level.txt,sha256=omzIr_m5qnzhfcdscOVr4P4JUB49wlP6KztqvlqDntw,7
|
|
73
|
+
hk_cdp-1.0.107.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|