/td> 34
+    coupon_level5_amount = models.IntegerField(_(u'coupon_level5_amount'), default=0, blank=True, null=True, help_text=u'金额(单位:分)')
35
+    coupon_detail = RichTextField(_(u'coupon_detail'), blank=True, null=True, help_text=u'券详情')
36
+
37
+    class Meta:
38
+        verbose_name = _(u'券信息')
39
+        verbose_name_plural = _(u'券信息')
40
+
41
+    def __unicode__(self):
42
+        return unicode(self.pk)

+ 6 - 0
coupon/tests.py

@@ -0,0 +1,6 @@
1
+# -*- coding: utf-8 -*-
2
+from __future__ import unicode_literals
3
+
4
+from django.test import TestCase
5
+
6
+# Create your tests here.

+ 6 - 0
coupon/views.py

@@ -0,0 +1,6 @@
1
+# -*- coding: utf-8 -*-
2
+from __future__ import unicode_literals
3
+
4
+from django.shortcuts import render
5
+
6
+# Create your views here.

+ 1 - 0
kodo/settings.py

@@ -54,6 +54,7 @@ INSTALLED_APPS = (
54 54
     'account',
55 55
     'box',
56 56
     'commands',
57
+    'coupon',
57 58
     'group',
58 59
     'guideline',
59 60
     'integral',

+ 5 - 0
mch/admin.py

@@ -196,6 +196,11 @@ class ActivityInfoAdmin(admin.ModelAdmin):
196 196
     list_display = ('activity_name', 'model_uni_names', 'start_at', 'end_at', 'coupon_expire_type', 'coupon_valid_period', 'coupon_expire_at', 'coupon_value', 'status', 'created_at', 'updated_at')
197 197
     list_filter = ('coupon_expire_type', 'status')
198 198
 
199
+    def save_model(self, request, obj, form, change):
200
+        obj.save()
201
+
202
+        # TODO: Update coupon relative
203
+
199 204
 
200 205
 admin.site.register(AdministratorInfo, AdministratorInfoAdmin)
201 206
 admin.site.register(OperatorInfo, OperatorInfoAdmin)

+ 20 - 0
mch/migrations/0041_activityinfo_coupon_id.py

@@ -0,0 +1,20 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.26 on 2019-12-21 06:19
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations, models
6
+
7
+
8
+class Migration(migrations.Migration):
9
+
10
+    dependencies = [
11
+        ('mch', '0040_modelinfo_shot_member_name'),
12
+    ]
13
+
14
+    operations = [
15
+        migrations.AddField(
16
+            model_name='activityinfo',
17
+            name='coupon_id',
18
+            field=models.CharField(blank=True, db_index=True, help_text='\u5238\u552f\u4e00\u6807\u8bc6', max_length=32, null=True, verbose_name='coupon_id'),
19
+        ),
20
+    ]

+ 2 - 0
mch/models.py

@@ -615,6 +615,8 @@ class ActivityInfo(BaseModelMixin):
615 615
     start_at = models.DateTimeField(_(u'start_at'), help_text=_(u'start_at'))
616 616
     end_at = models.DateTimeField(_(u'end_at'), help_text=_(u'end_at'))
617 617
 
618
+    coupon_id = models.CharField(_(u'coupon_id'), max_length=32, blank=True, null=True, help_text=u'券唯一标识', db_index=True)
619
+
618 620
     coupon_expire_type = models.IntegerField(_(u'coupon_expire_type'), choices=COUPON_EXPIRED_TIME_TUPLE, default=FIXED_EXPIRED_TIME, help_text=_(u'维修券类型'))
619 621
     coupon_valid_period = models.IntegerField(_(u'coupon_valid_period'), default=0, help_text=_(u'维修券有效时间(单位:天)'))
620 622
     coupon_expire_at = models.DateTimeField(_(u'coupon_expire_at'), blank=True, null=True, help_text=_(u'维修券过期时间'))

+ 5 - 0
member/admin.py

@@ -30,6 +30,11 @@ class RightInfoAdmin(admin.ModelAdmin):
30 30
     list_display = ('right_id', 'right_type', 'icon', 'title', 'subtitle', 'detail', 'level1', 'level2', 'level3', 'level4', 'level5', 'minlevel', 'position', 'is_send_coupon', 'coupon_valid_period', 'coupon_num', 'status', 'created_at', 'updated_at')
31 31
     list_filter = ('right_type', 'is_send_coupon', 'status')
32 32
 
33
+    def save_model(self, request, obj, form, change):
34
+        obj.save()
35
+
36
+        # TODO: Update coupon relative
37
+
33 38
 
34 39
 class CouponInfoAdmin(admin.ModelAdmin):
35 40
     list_display = ('coupon_id', 'user_id', 'coupon_valid_period', 'coupon_amount', 'coupon_detail', 'active_at', 'expire_at', 'right_id', 'right_type', 'icon', 'title', 'subtitle', 'detail', 'status', 'created_at', 'updated_at')

+ 23 - 0
member/migrations/0012_auto_20191221_1419.py

@@ -0,0 +1,23 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.26 on 2019-12-21 06:19
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations, models
6
+
7
+
8
+class Migration(migrations.Migration):
9
+
10
+    dependencies = [
11
+        ('member', '0011_auto_20191212_1827'),
12
+    ]
13
+
14
+    operations = [
15
+        migrations.DeleteModel(
16
+            name='MemberCouponInfo',
17
+        ),
18
+        migrations.AddField(
19
+            model_name='rightinfo',
20
+            name='coupon_id',
21
+            field=models.CharField(blank=True, db_index=True, help_text='\u5238\u552f\u4e00\u6807\u8bc6', max_length=32, null=True, verbose_name='coupon_id'),
22
+        ),
23
+    ]

+ 4 - 52
member/models.py

@@ -92,6 +92,7 @@ class GoodsInfo(BaseModelMixin):
92 92
             'desc': self.desc,
93 93
         }
94 94
 
95
+
95 96
 class GoodsOrderInfo(BaseModelMixin):
96 97
     PHYSICAL = 0
97 98
     VIRTUAL = 1
@@ -163,6 +164,9 @@ class RightInfo(BaseModelMixin):
163 164
 
164 165
     # 券相关
165 166
     is_send_coupon = models.BooleanField(_(u'is_send_coupon'), default=False, help_text=_(u'是否发券'), db_index=True)
167
+
168
+    coupon_id = models.CharField(_(u'coupon_id'), max_length=32, blank=True, null=True, help_text=u'券唯一标识', db_index=True)
169
+
166 170
     coupon_valid_period = models.IntegerField(_(u'coupon_valid_period'), default=0, help_text=_(u'券有效时间(单位:天)'))
167 171
     coupon_num = models.IntegerField(_(u'coupon_num'), default=0, help_text=_(u'券每会员级别发放张数'))
168 172
     coupon_level1_amount = models.IntegerField(_(u'coupon_level1_amount'), default=0, blank=True, null=True, help_text=u'金额(单位:分)')
@@ -476,55 +480,3 @@ class MemberActivitySigninInfo(BaseModelMixin):
476 480
 
477 481
     def __unicode__(self):
478 482
         return unicode(self.pk)
479
-
480
-
481
-class MemberCouponInfo(BaseModelMixin):
482
-    DEEP_CLEANING = 0
483
-    FREE_FOCUS = 1
484
-    CLEAN_APPEARANCE = 2
485
-    ACCIDENTAL_MAINTENANCE = 3
486
-    MAINTENANCE_MANPOWER = 4
487
-
488
-    COUPON_TYPE_TUPLE = (
489
-        (DEEP_CLEANING, u'深度清洁'),
490
-        (FREE_FOCUS, u'免费调焦'),
491
-        (CLEAN_APPEARANCE, u'外观清洁'),
492
-        (ACCIDENTAL_MAINTENANCE, u'意外维修'),
493
-        (MAINTENANCE_MANPOWER, u'维修人工')
494
-    )
495
-
496
-    brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
497
-    brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
498
-
499
-    coupon_id = ShortUUIDField(_(u'coupon_id'), max_length=32, blank=True, null=True, help_text=u'券唯一标识', db_index=True, unique=True)
500
-
501
-    user_id = models.CharField(_(u'user_id'), max_length=32, blank=True, null=True, help_text=u'用户唯一标识', db_index=True)
502
-
503
-    coupon_type = models.IntegerField(_(u'coupon_type'), choices=COUPON_TYPE_TUPLE, default=DEEP_CLEANING, help_text=u'券类型', db_index=True)
504
-    coupon_start_at = models.DateTimeField(_(u'coupon_start_at'), blank=True, null=True, help_text=u'券生效时间')
505
-    coupon_expire_at = models.DateTimeField(_(u'coupon_expire_at'), blank=True, null=True, help_text=u'券过期时间')
506
-    coupon_value = models.IntegerField(_(u'coupon_value'), default=0, help_text=u'券金额(单位:分)')
507
-
508
-    has_used = models.BooleanField(_(u'has_used'), default=False, help_text=u'是否已核销', db_index=True)
509
-    admin_id = models.CharField(_(u'admin_id'), max_length=32, blank=True, null=True, help_text=u'核销员唯一标识', db_index=True)
510
-    used_at = models.DateTimeField(_(u'used_at'), blank=True, null=True, help_text=u'维修券核销时间')
511
-
512
-    class Meta:
513
-        verbose_name = _(u'会员券信息')
514
-        verbose_name_plural = _(u'会员券信息')
515
-
516
-    def __unicode__(self):
517
-        return unicode(self.pk)
518
-
519
-    @property
520
-    def data(self):
521
-        return {
522
-            'coupon_id': self.coupon_id,
523
-            'coupon_type': self.coupon_type,
524
-            'coupon_start_at': tc.local_string(self.coupon_start_at, format='%Y%m%d'),
525
-            'coupon_expire_at': tc.local_string(self.coupon_expire_at, format='%Y%m%d'),
526
-            'coupon_value': self.coupon_value,
527
-            'has_used': self.has_used,
528
-            'admin_id': self.admin_id,
529
-            'used_at': tc.local_string(self.used_at, format='%Y%m%d'),
530
-        }

kodo - Gogs: Go Git Service

Nav apraksta

index.html 1.7KB

    <!doctype html> <html> <head> <meta charset="UTF-8"> <title>拍爱 PAI.AI 首页</title> <meta name="keywords" content="摄影 图片 影像 分享 交流 社交 交友 摄影师 女性 孩子 亲子 旅行 旅游 约拍 iphone android app" /> <link href="css/layout.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="js/jquery.min.js"></script> </head> <body class="content_bg"> <div id="header"> <div class="content"> <a href="index.html" target="_self" class="logo"></a> <div class="navigation"> <a href="contactus.html" target="_self" >联系我们</a> <a href="joinus.html" target="_self" >加入拍爱</a> <a href="aboutus.html" target="_self" >关于我们</a> <a href="index.html" target="_self" class="current" >首页</a> </div> </div> </div> <div id="container" > <div class="content"> <div class="container_box"> <div class="mobile"></div> <div class="mb_img"></div> <div class="article"><span>即拍即分享</span><p>一起走过的路,<br>一起看过的美景,<br>一起醉过的Party,......<br>回忆容易消逝,<br>一起拍,照片让爱历久弥新。</p></div> <a href="https://itunes.apple.com/cn/app/pai-aipaiai/id1163960351?mt=8" target="_blank" class="ios_download">iPhone下载</a> <a href="" target="_blank" class="android_download">安卓下载</a> </div> </div> </div> <div id="footer"> <div class="content foot homefooter"> <a href="aboutus.html" target="_self" >关于我们</a> <span>|</span> <a href="contactus.html" target="_self" >联系我们</a> ©2016 拍爱 PAI.AI 琼ICP备16000076号 </div> </div> </body> </html>