td class="lines-num lines-num-old"> 44
+            model_name='roominfo',
45
+            name='start_time',
46
+            field=models.IntegerField(blank=True, db_index=True, help_text='直播计划开始时间', verbose_name='start_time'),
47
+        ),
48
+    ]

+ 28 - 0
live/migrations/0010_auto_20200520_1716.py

@@ -0,0 +1,28 @@
1
+# Generated by Django 2.2.12 on 2020-05-20 09:16
2
+
3
+from django.db import migrations, models
4
+
5
+
6
+class Migration(migrations.Migration):
7
+
8
+    dependencies = [
9
+        ('live', '0009_auto_20200520_1652'),
10
+    ]
11
+
12
+    operations = [
13
+        migrations.AlterField(
14
+            model_name='roominfo',
15
+            name='end_time',
16
+            field=models.IntegerField(blank=True, db_index=True, default=0, help_text='直播计划结束时间', verbose_name='end_time'),
17
+        ),
18
+        migrations.AlterField(
19
+            model_name='roominfo',
20
+            name='live_status',
21
+            field=models.IntegerField(blank=True, db_index=True, default=0, help_text='直播状态', verbose_name='live_status'),
22
+        ),
23
+        migrations.AlterField(
24
+            model_name='roominfo',
25
+            name='start_time',
26
+            field=models.IntegerField(blank=True, db_index=True, default=0, help_text='直播计划开始时间', verbose_name='start_time'),
27
+        ),
28
+    ]

+ 16 - 14
live/models.py

@@ -45,14 +45,16 @@ class AnchorInfo(BaseModelMixin):
45 45
 class RoomInfo(BaseModelMixin):
46 46
     room_id = models.CharField(_('anchor_id'), max_length=32, help_text='房间唯一标识', db_index=True, unique=True)
47 47
     name = models.CharField(_('name'), max_length=255, blank=True, help_text='直播房间名', db_index=True)
48
-    live_status = models.IntegerField(_('live_status'), help_text='直播状态', db_index=True)
49
-    start_time = models.IntegerField(_('start_time'), help_text='直播计划开始时间', db_index=True)
50
-    end_time = models.IntegerField(_('end_time'), help_text='直播计划结束时间', db_index=True)
51
-    cover_img = models.ImageField(_('cover_img'), upload_to=upload_path, help_text='直播间背景墙')
48
+    live_status = models.IntegerField(_('live_status'), default=0, blank=True, help_text='直播状态', db_index=True)
49
+    start_time = models.IntegerField(_('start_time'), default=0, blank=True, help_text='直播计划开始时间', db_index=True)
50
+    end_time = models.IntegerField(_('end_time'), default=0, blank=True, help_text='直播计划结束时间', db_index=True)
51
+    cover_img = models.ImageField(_('cover_img'), upload_to=upload_path, null=True, help_text='直播间背景墙')
52
+    wx_cover_img = models.CharField(_('wx_cover_img'), blank=True, max_length=255, help_text='微信直播背景墙', db_index=True)
53
+    share_img = models.ImageField(_('share_img'), upload_to=upload_path, null=True, help_text='分享卡片图片')
54
+    wx_share_img = models.CharField(_('wx_share_img'), blank=True, max_length=255, help_text='微信直播分享卡片图片', db_index=True)
55
+
56
+    anchor_id = models.CharField(_('anchor_id'), blank=True, max_length=32, help_text='主播唯一标识')
52 57
     anchor_name = models.CharField(_('anchor_name'), blank=True, max_length=255, help_text='主播名称', db_index=True)
53
-    share_img = models.ImageField(_('share_img'), upload_to=upload_path, help_text='分享卡片图片')
54
-
55
-    anchor_id = models.CharField(_('anchor_id'), max_length=32, help_text='主播唯一标识')
56 58
     
57 59
     # "goods": [          
58 60
     #     {
@@ -93,8 +95,8 @@ class RoomInfo(BaseModelMixin):
93 95
             'room_id': self.room_id,
94 96
             'name': self.name,
95 97
             'live_status': self.live_status,
96
-            'cover_img': self.cover_img_url,
97
-            'share_img': self.share_img_url,
98
+            'cover_img': self.wx_cover_img,
99
+            'share_img': self.wx_share_img,
98 100
         }
99 101
        
100 102
     @property
@@ -105,9 +107,9 @@ class RoomInfo(BaseModelMixin):
105 107
             'name': self.name,
106 108
             'live_status': self.live_status,
107 109
             'end_time': self.end_time,
108
-            'cover_img': self.cover_img_url,
110
+            'cover_img': self.wx_cover_img,
109 111
             'anchor_name': self.anchor_name,
110
-            'share_img': self.share_img_url,
112
+            'share_img': self.wx_share_img,
111 113
             'anchor_id': self.anchor_id,
112 114
             'anchor_name': anchor.anchor_name,
113 115
             'anchor_avatar': anchor.anchor_avatar_url
@@ -137,9 +139,9 @@ class liveGoodsInfo(BaseModelMixin):
137 139
     name = models.CharField(_('name'), max_length=34, help_text='商品', blank=True, db_index=True)
138 140
 
139 141
     # 价格类型,1:一口价,2:价格区间,3:显示折扣价;1:一口价,只需要传入price,price2不传;2:价格区间,price字段为左边界,price2字段为右边界,price和price2必传。3:折扣价,price字段为原价,price2字段为现价, price和price2必传
140
-    price_type = models.IntegerField(_('price_type'), help_text='价格类型', db_index=True)
141
-    price = models.IntegerField(_('price'), help_text='price')
142
-    price2 = models.IntegerField(_('price2'), help_text='price2')
142
+    price_type = models.IntegerField(_('price_type'), blank=True, help_text='价格类型', db_index=True)
143
+    price = models.IntegerField(_('price'), blank=True, help_text='price')
144
+    price2 = models.IntegerField(_('price2'), blank=True, help_text='price2')
143 145
     url = models.CharField(_('url'), max_length=255, blank=True, help_text='小程序商品路径', db_index=True)
144 146
 
145 147
     class Meta:

+ 2 - 1
requirements_pywe.txt

@@ -2,4 +2,5 @@ pywe_miniapp==1.1.5
2 2
 pywe-oauth==1.1.1
3 3
 pywe-pay==1.0.14
4 4
 pywe-pay-notify==1.0.5
5
-pywe-response==1.0.1
5
+pywe-response==1.0.1
6
+pywe-token===1.3.1

kodo - Gogs: Go Git Service

Nessuna descrizione

0003_provincesalestatisticinfo_position.py 530B

    # -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-04-25 13:25 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('statistic', '0002_provincesalestatisticinfo'), ] operations = [ migrations.AddField( model_name='provincesalestatisticinfo', name='position', field=models.IntegerField(default=1, help_text='\u6392\u5e8f', verbose_name='position'), ), ]