""> 28
+        ),
29
+        migrations.AddField(
30
+            model_name='memberactivityinfo',
31
+            name='start_date',
32
+            field=models.DateField(blank=True, help_text='活动报名开始日期', null=True, verbose_name='start_date'),
33
+        ),
34
+        migrations.AddField(
35
+            model_name='memberactivityinfo',
36
+            name='start_display_date',
37
+            field=models.DateField(blank=True, help_text='活动展示开始日期', null=True, verbose_name='start_display_date'),
38
+        ),
39
+    ]

+ 19 - 0
member/migrations/0034_memberactivityinfo_limit_image_num.py

@@ -0,0 +1,19 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 3.2.16 on 2022-10-23 05:28
3
+
4
+from django.db import migrations, models
5
+
6
+
7
+class Migration(migrations.Migration):
8
+
9
+    dependencies = [
10
+        ('member', '0033_auto_20221021_2212'),
11
+    ]
12
+
13
+    operations = [
14
+        migrations.AddField(
15
+            model_name='memberactivityinfo',
16
+            name='limit_image_num',
17
+            field=models.IntegerField(default=3, help_text='限制图片数量', verbose_name='limit_image_num'),
18
+        ),
19
+    ]

+ 76 - 34
member/models.py

@@ -124,7 +124,7 @@ class GoodsInfo(BaseModelMixin):
124 124
             'value': self.value,
125 125
             'left_num': self.left_num,
126 126
             'coupon': coupon,
127
-            'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d %H:%M:%S'),
127
+            'created_at': tc.local_string(utc_dt=self.created_at),
128 128
         }
129 129
 
130 130
     @property
@@ -147,7 +147,7 @@ class GoodsInfo(BaseModelMixin):
147 147
             'desc': self.desc,
148 148
             'left_num': self.left_num,
149 149
             'coupon': coupon,
150
-            'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d %H:%M:%S'),
150
+            'created_at': tc.local_string(utc_dt=self.created_at),
151 151
         }
152 152
 
153 153
 
@@ -207,7 +207,7 @@ class GoodsOrderInfo(BaseModelMixin):
207 207
             'user_address': self.address,
208 208
             'tracking_number': self.tracking_number,
209 209
             'integral': self.integral,
210
-            'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d %H:%M:%S'),
210
+            'created_at': tc.local_string(utc_dt=self.created_at),
211 211
             'send_template_message_res': json.loads(self.send_template_message_res) if self.send_template_message_res else '',
212 212
             'remark': self.remark
213 213
         }
@@ -342,20 +342,35 @@ class ShotTypeInfo(BaseModelMixin):
342 342
 
343 343
 
344 344
 class MemberActivityInfo(BaseModelMixin):
345
+    ACTIVITY_TYPE = (
346
+        (0, u'线下活动'),
347
+        (1, u'公众号文章'),
348
+        (2, u'线上活动'),
349
+        (3, u'投稿活动'),
350
+    )
351
+
345 352
     ACTIVITY_STATE = (
346 353
         (0, u'草稿'),
347 354
         (1, u'已发布'),
348 355
         (2, u'下线'),
349 356
     )
357
+
350 358
     brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, default='', help_text=u'品牌唯一标识', db_index=True)
351 359
     brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, default='', help_text=u'品牌名称')
352 360
 
353 361
     activity_id = ShortUUIDField(_(u'activity_id'), max_length=32, blank=True, help_text=u'活动唯一标识', db_index=True, unique=True)
354 362
 
363
+    activity_type = models.IntegerField(_(u'activity_type'), choices=ACTIVITY_TYPE, default=0, help_text=u'活动类型', db_index=True)
364
+
355 365
     title = models.CharField(_(u'title'), max_length=255, blank=True, default='', help_text=u'活动名称')
356 366
     subtitle = models.CharField(_(u'subtitle'), max_length=255, blank=True, default='', help_text=u'活动二级名称')
357 367
 
358 368
     date = models.DateField(_(u'date'), blank=True, null=True, help_text=u'活动时间')
369
+    start_date = models.DateField(_(u'start_date'), blank=True, null=True, help_text=u'活动报名开始日期')
370
+    end_date = models.DateField(_(u'end_date'), blank=True, null=True, help_text=u'活动报名截止日期')
371
+    start_display_date = models.DateField(_(u'start_display_date'), blank=True, null=True, help_text=u'活动展示开始日期')
372
+    end_display_date = models.DateField(_(u'end_display_date'), blank=True, null=True, help_text=u'活动展示截止日期')
373
+
359 374
     city = models.CharField(_(u'city'), max_length=255, blank=True, default='', help_text=u'活动城市')
360 375
     location = models.CharField(_(u'location'), max_length=255, blank=True, default='', help_text=u'活动地点')
361 376
     lat = models.FloatField(_(u'lat'), default=1.0, help_text=u'纬度')
@@ -365,12 +380,11 @@ class MemberActivityInfo(BaseModelMixin):
365 380
     group_share_integral = models.IntegerField(_(u'group_share_integral'), default=0, help_text=u'群组分享会员积分')
366 381
     group_share_max_integral = models.IntegerField(_(u'group_share_max_integral'), default=0, help_text=u'群组分享会员积分单人上限')
367 382
 
368
-    image = models.ImageField(_(u'image'), upload_to=upload_path, blank=True, help_text=u'活动内容图片')
369
-
370
-    cover = models.ImageField(_(u'cover'), upload_to=upload_path, blank=True, help_text=u'活动列表图片')
371
-
372 383
     is_slider = models.BooleanField(_(u'is_slider'), default=True, help_text=u'是否为轮播活动')
373 384
     slider_image = models.ImageField(_(u'slider_image'), upload_to=upload_path, blank=True, help_text=u'活动轮播图片')
385
+    cover = models.ImageField(_(u'cover'), upload_to=upload_path, blank=True, help_text=u'活动列表图片')
386
+    limit_image_num = models.IntegerField(_(u'limit_image_num'), default=3, help_text=u'限制图片数量')
387
+    image = models.ImageField(_(u'image'), upload_to=upload_path, blank=True, help_text=u'活动内容图片')
374 388
 
375 389
     content_rich_text = RichTextField(_(u'content_rich_text'), blank=True, default='', help_text=u'活动描述')
376 390
 
@@ -393,12 +407,12 @@ class MemberActivityInfo(BaseModelMixin):
393 407
         return '%d' % self.pk
394 408
 
395 409
     @property
396
-    def image_path(self):
397
-        return upload_file_path(self.image)
410
+    def slider_image_path(self):
411
+        return upload_file_path(self.slider_image)
398 412
 
399 413
     @property
400
-    def image_url(self):
401
-        return qiniu_file_url(self.image.name, bucket='tamron') if self.is_upload_qiniu else upload_file_url(self.image)
414
+    def slider_image_url(self):
415
+        return qiniu_file_url(self.slider_image.name, bucket='tamron') if self.is_upload_qiniu else upload_file_url(self.slider_image)
402 416
 
403 417
     @property
404 418
     def cover_path(self):
@@ -408,13 +422,13 @@ class MemberActivityInfo(BaseModelMixin):
408 422
     def cover_url(self):
409 423
         return qiniu_file_url(self.cover.name, bucket='tamron') if self.is_upload_qiniu else upload_file_url(self.cover)
410 424
 
411
-    @property
412
-    def slider_image_path(self):
413
-        return upload_file_path(self.slider_image)
414
-
415
-    @property
416
-    def slider_image_url(self):
417
-        return qiniu_file_url(self.slider_image.name, bucket='tamron') if self.is_upload_qiniu else upload_file_url(self.slider_image)
425
+    # @property
426
+    # def image_path(self):
427
+    #     return upload_file_path(self.image)
428
+    #
429
+    # @property
430
+    # def image_url(self):
431
+    #     return qiniu_file_url(self.image.name, bucket='tamron') if self.is_upload_qiniu else upload_file_url(self.image)
418 432
 
419 433
     @property
420 434
     def final_state(self):
@@ -435,18 +449,25 @@ class MemberActivityInfo(BaseModelMixin):
435 449
         return {
436 450
             'id': self.activity_id,
437 451
             'activity_id': self.activity_id,
452
+            'activity_type': self.activity_type,
453
+            'activity_type_str': dict(MemberActivityInfo.ACTIVITY_TYPE).get(self.activity_type),
438 454
             'title': self.title,
439 455
             'subtitle': self.subtitle,
440
-            'date': self.date.strftime('%Y-%m-%d'),
456
+            'date': tc.local_date_string(self.date),
457
+            'start_date': tc.local_date_string(self.start_date),
458
+            'end_date': tc.local_date_string(self.end_date),
459
+            'start_display_date': tc.local_date_string(self.start_display_date),
460
+            'end_display_date': tc.local_date_string(self.end_display_date),
441 461
             'city': self.city,
442 462
             'location': self.location,
443 463
             'lat': self.lat,
444 464
             'lon': self.lon,
445 465
             'integral': self.integral,
466
+            'slider_image': self.slider_image_url,
446 467
             'cover_url': self.cover_url,
468
+            'limit_image_num': self.limit_image_num,
447 469
             'share_img_link': self.share_img_link,
448 470
             'share_h5_link': self.share_h5_link,
449
-            'slider_image': self.slider_image_url,
450 471
             'state': self.final_state,
451 472
             'is_signed': self.is_signed(user_id),
452 473
             'is_signup': self.is_signup,
@@ -456,19 +477,26 @@ class MemberActivityInfo(BaseModelMixin):
456 477
         return {
457 478
             'id': self.activity_id,
458 479
             'activity_id': self.activity_id,
480
+            'activity_type': self.activity_type,
481
+            'activity_type_str': dict(MemberActivityInfo.ACTIVITY_TYPE).get(self.activity_type),
459 482
             'title': self.title,
460 483
             'subtitle': self.subtitle,
461
-            'date': self.date.strftime('%Y-%m-%d'),
484
+            'date': tc.local_date_string(self.date),
485
+            'start_date': tc.local_date_string(self.start_date),
486
+            'end_date': tc.local_date_string(self.end_date),
487
+            'start_display_date': tc.local_date_string(self.start_display_date),
488
+            'end_display_date': tc.local_date_string(self.end_display_date),
462 489
             'city': self.city,
463 490
             'location': self.location,
464 491
             'lat': self.lat,
465 492
             'lon': self.lon,
466 493
             'integral': self.integral,
467
-            'content_rich_text': self.content_rich_text,
494
+            'slider_image': self.slider_image_url,
468 495
             'cover_url': self.cover_url,
496
+            'limit_image_num': self.limit_image_num,
497
+            'content_rich_text': self.content_rich_text,
469 498
             'share_img_link': self.share_img_link,
470 499
             'share_h5_link': self.share_h5_link,
471
-            'slider_image': self.slider_image_url,
472 500
             'state': self.final_state,
473 501
             'is_signed': self.is_signed(user_id),
474 502
             'is_signup': self.is_signup,
@@ -479,25 +507,32 @@ class MemberActivityInfo(BaseModelMixin):
479 507
         return {
480 508
             'id': self.activity_id,
481 509
             'activity_id': self.activity_id,
510
+            'activity_type': self.activity_type,
511
+            'activity_type_str': dict(MemberActivityInfo.ACTIVITY_TYPE).get(self.activity_type),
482 512
             'title': self.title,
483 513
             'subtitle': self.subtitle,
484
-            'date': self.date.strftime('%Y-%m-%d'),
514
+            'date': tc.local_date_string(self.date),
515
+            'start_date': tc.local_date_string(self.start_date),
516
+            'end_date': tc.local_date_string(self.end_date),
517
+            'start_display_date': tc.local_date_string(self.start_display_date),
518
+            'end_display_date': tc.local_date_string(self.end_display_date),
485 519
             'city': self.city,
486 520
             'location': self.location,
487 521
             'lat': self.lat,
488 522
             'lon': self.lon,
489 523
             'integral': self.integral,
524
+            'is_slider': self.is_slider,
525
+            'slider_image': self.slider_image_url,
490 526
             'cover_url': self.cover_url,
527
+            'limit_image_num': self.limit_image_num,
491 528
             'share_img_link': self.share_img_link,
492 529
             'share_h5_link': self.share_h5_link,
493
-            'slider_image': self.slider_image_url,
494 530
             'state': self.final_state,
495 531
             'is_signup': self.is_signup,
496 532
             'share_integral': self.group_share_integral,
497 533
             'share_max_integral': self.group_share_max_integral,
498
-            'is_slider': self.is_slider,
499 534
             'activity_state': self.activity_state,
500
-            'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d %H:%M:%S'),
535
+            'created_at': tc.local_string(utc_dt=self.created_at),
501 536
         }
502 537
 
503 538
     @property
@@ -505,28 +540,35 @@ class MemberActivityInfo(BaseModelMixin):
505 540
         return {
506 541
             'id': self.activity_id,
507 542
             'activity_id': self.activity_id,
543
+            'activity_type': self.activity_type,
544
+            'activity_type_str': dict(MemberActivityInfo.ACTIVITY_TYPE).get(self.activity_type),
508 545
             'title': self.title,
509 546
             'subtitle': self.subtitle,
510
-            'date': self.date.strftime('%Y-%m-%d'),
547
+            'date': tc.local_date_string(self.date),
548
+            'start_date': tc.local_date_string(self.start_date),
549
+            'end_date': tc.local_date_string(self.end_date),
550
+            'start_display_date': tc.local_date_string(self.start_display_date),
551
+            'end_display_date': tc.local_date_string(self.end_display_date),
511 552
             'city': self.city,
512 553
             'location': self.location,
513 554
             'lat': self.lat,
514 555
             'lon': self.lon,
515 556
             'integral': self.integral,
516
-            'content_rich_text': self.content_rich_text,
557
+            'is_slider': self.is_slider,
558
+            'banner_path': self.slider_image_path,
559
+            'slider_image': self.slider_image_url,
560
+            'cover_path': self.cover_path,
517 561
             'cover_url': self.cover_url,
562
+            'limit_image_num': self.limit_image_num,
563
+            'content_rich_text': self.content_rich_text,
518 564
             'share_img_link': self.share_img_link,
519 565
             'share_h5_link': self.share_h5_link,
520
-            'slider_image': self.slider_image_url,
521 566
             'state': self.final_state,
522 567
             'is_signup': self.is_signup,
523 568
             'share_integral': self.group_share_integral,
524 569
             'share_max_integral': self.group_share_max_integral,
525 570
             'activity_state': self.activity_state,
526
-            'is_slider': self.is_slider,
527
-            'banner_path': self.slider_image_path,
528
-            'cover_path': self.cover_path,
529
-            'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d %H:%M:%S'),
571
+            'created_at': tc.local_string(utc_dt=self.created_at),
530 572
         }
531 573
 
532 574
 

+ 1 - 1
requirements.txt

@@ -1,7 +1,7 @@
1 1
 CodeConvert==3.0.2
2 2
 Pillow==9.2.0
3 3
 StatusCode==1.0.0
4
-TimeConvert==2.0.3
4
+TimeConvert==2.0.4
5 5
 furl==2.1.3
6 6
 isoweek==1.3.3
7 7
 jsonfield==3.1.0

+ 1 - 1
requirements_dj.txt

@@ -1,4 +1,4 @@
1
-Django==3.2.14
1
+Django==3.2.16
2 2
 django-admin==2.0.1
3 3
 django-cors-headers==3.10.0
4 4
 django-curtail-uuid==1.0.4

kodo - Gogs: Go Git Service

Brak opisu

huangqimin001: 059758e746 :art: Support maintenance_tracking_info_subscribe 4 lat temu
account c01f5a3b5b :art: Add coupon_expire_at 4 lat temu
api 059758e746 :art: Support maintenance_tracking_info_subscribe 4 lat temu
commands 945761de88 :art: Conpon2 4 lat temu
coupon e7da55aaf2 :art: Add complement_code 5 lat temu
docs 212e3994d1 MP verify file 8 lat temu
guideline 88b564d033 fix coercing to Unicode: need string or buffer, long found 5 lat temu
integral 020c5c128d :art: everyday_continue_send_user_coupon 4 lat temu
kodo fe160a49f1 :art: Kuaidi100 4 lat temu
logs 33468847a7 fix bug: operator_name decode 4 lat temu
maintenance 8f2e4e1f5b :art: ExpressCompanyInfoAdmin 4 lat temu
marketcode 88b564d033 fix coercing to Unicode: need string or buffer, long found 5 lat temu
mch 1658c01b17 maintenance_add add model_id log_id 4 lat temu
member aa2144ebb6 :art: RightInfoAdmin 4 lat temu
miniapp 1244a5a931 :art: Update MEMBER_CARD_ID_TAMRON 4 lat temu
operation e7da55aaf2 :art: Add complement_code 5 lat temu
page 15fb258bf3 Merge branch 'tamron' of http://git.xfoto.com.cn/Kodo/kodo into tamron 4 lat temu
pre d6d555d47b :art: init_express_company 4 lat temu
sales 88b564d033 fix coercing to Unicode: need string or buffer, long found 5 lat temu
server 018d52f61d Update package django_xxx 8 lat temu
shells 6270484a89 :art: fix_user_coupon_info 5 lat temu
simditor 3e9628d0c9 iSort & Pycodestyle 5 lat temu
staff e7da55aaf2 :art: Add complement_code 5 lat temu
statistic 88b564d033 fix coercing to Unicode: need string or buffer, long found 5 lat temu
utils 77224d884a :art: Support maintenance_tracking_info_subscribe 4 lat temu
website 597ee33ba6 Pai2 => Kodo 8 lat temu
.editorconfig 4defb80fdc gogs first init 10 lat temu
.gitignore 4ce7f5c87b :art: Member Relative APIs 6 lat temu
.isort.cfg afcdf74a49 add api group_data_api 10 lat temu
TODO.md d31ffaa118 Update TODO 9 lat temu
check.sh 95c1d32792 put isort and pep8 in check.sh 10 lat temu
isort.sh 3e9628d0c9 iSort & Pycodestyle 5 lat temu
manage.py 597ee33ba6 Pai2 => Kodo 8 lat temu
pep8.sh 511533855d Change oauth to use http 8 lat temu
requirements.txt 22a8246c88 :art: init_express_company 4 lat temu
requirements_deploy.txt 873b42cb2f :art: TimeConvert local_string utc_dt 6 lat temu
requirements_dev.txt 926f0ef06a Update requirements_xxx.txt 7 lat temu
requirements_dj.txt fccbd76d05 :art: Update requirement.txt 5 lat temu
requirements_pywe.txt 4239c95bdf :art: Update requirements.txt 4 lat temu
requirements_redis.txt 4239c95bdf :art: Update requirements.txt 4 lat temu
sysctl.sh 34c6774438 Opt 7 lat temu
adminSystem - Gogs: Go Git Service

説明なし

LICENSE 1.0KB

    The MIT License (MIT) Copyright (c) 2014 PostCSS Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.