/td> 7
+
8
+class Migration(migrations.Migration):
9
+
10
+    dependencies = [
11
+        ('mch', '0015_auto_20180508_1433'),
12
+    ]
13
+
14
+    operations = [
15
+        migrations.CreateModel(
16
+            name='BrandModelDistributorPriceInfo',
17
+            fields=[
18
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
19
+                ('status', models.BooleanField(db_index=True, default=True, help_text='Status', verbose_name='status')),
20
+                ('created_at', models.DateTimeField(auto_now_add=True, help_text='Create Time', verbose_name='created_at')),
21
+                ('updated_at', models.DateTimeField(auto_now=True, help_text='Update Time', verbose_name='updated_at')),
22
+                ('brand_id', models.CharField(blank=True, db_index=True, help_text='\u54c1\u724c\u552f\u4e00\u6807\u8bc6', max_length=32, null=True, verbose_name='brand_id')),
23
+                ('brand_name', models.CharField(blank=True, help_text='\u54c1\u724c\u540d\u79f0', max_length=255, null=True, verbose_name='brand_name')),
24
+                ('model_id', models.CharField(blank=True, db_index=True, help_text='\u578b\u53f7\u552f\u4e00\u6807\u8bc6', max_length=32, null=True, verbose_name='model_id')),
25
+                ('model_name', models.CharField(blank=True, help_text='\u578b\u53f7\u540d\u79f0', max_length=255, null=True, verbose_name='model_name')),
26
+                ('distributor_id', models.CharField(blank=True, db_index=True, help_text='\u7ecf\u9500\u5546\u552f\u4e00\u6807\u8bc6', max_length=32, null=True, verbose_name='distributor_id')),
27
+                ('distributor_name', models.CharField(blank=True, help_text='\u7ecf\u9500\u5546\u540d\u79f0', max_length=255, null=True, verbose_name='distributor_name')),
28
+                ('factory_yuan', models.FloatField(default=1000, help_text='\u51fa\u5382\u4ef7(\u5143)', verbose_name='factory_yuan')),
29
+                ('factory_fee', models.IntegerField(default=100000, help_text='\u51fa\u5382\u4ef7(\u5206)', verbose_name='factory_fee')),
30
+                ('integral', models.IntegerField(default=100, help_text='\u79ef\u5206', verbose_name='integral')),
31
+            ],
32
+            options={
33
+                'verbose_name': '\u578b\u53f7/\u4ee3\u7406\u5546\u4ef7\u683c\u4fe1\u606f',
34
+                'verbose_name_plural': '\u578b\u53f7/\u4ee3\u7406\u5546\u4ef7\u683c\u4fe1\u606f',
35
+            },
36
+        ),
37
+        migrations.AlterUniqueTogether(
38
+            name='brandmodeldistributorpriceinfo',
39
+            unique_together=set([('brand_id', 'model_id', 'distributor_id')]),
40
+        ),
41
+    ]

+ 59 - 0
mch/models.py

@@ -6,6 +6,36 @@ from django_models_ext import BaseModelMixin, ProvinceShortModelMixin, upload_fi
6 6
 from shortuuidfield import ShortUUIDField
7 7
 
8 8
 
9
+class AdministratorInfo(BaseModelMixin):
10
+    ACTIVATED = 1
11
+    DISABLED = 2
12
+
13
+    USER_STATUS_TUPLE = (
14
+        (ACTIVATED, u'已激活'),
15
+        (DISABLED, u'已禁用'),
16
+    )
17
+
18
+    admin_id = ShortUUIDField(_(u'admin_id'), max_length=32, blank=True, null=True, help_text=u'管理员唯一标识', db_index=True, unique=True)
19
+
20
+    phone = models.CharField(_(u'phone'), max_length=16, blank=True, null=True, help_text=u'管理员电话', db_index=True)
21
+    password = models.CharField(_(u'password'), max_length=255, blank=True, null=True, help_text=u'管理员密码')
22
+    encryption = models.CharField(_(u'encryption'), max_length=255, blank=True, null=True, help_text=u'管理员密码')
23
+
24
+    name = models.CharField(_(u'name'), max_length=255, blank=True, null=True, help_text=u'管理员姓名')
25
+
26
+    brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
27
+    brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
28
+
29
+    user_status = models.IntegerField(_(u'user_status'), choices=USER_STATUS_TUPLE, default=ACTIVATED, help_text=u'管理员状态', db_index=True)
30
+
31
+    class Meta:
32
+        verbose_name = _(u'管理员信息')
33
+        verbose_name_plural = _(u'管理员信息')
34
+
35
+    def __unicode__(self):
36
+        return u'{}-{}'.format(self.name, self.phone)
37
+
38
+
9 39
 class OperatorInfo(BaseModelMixin):
10 40
     ACTIVATED = 1
11 41
     DISABLED = 2
@@ -77,6 +107,9 @@ class ModelInfo(BaseModelMixin):
77 107
     image = models.ImageField(_(u'image'), upload_to=upload_path, blank=True, null=True, help_text=u'图片')
78 108
     url = models.CharField(_(u'url'), max_length=255, blank=True, null=True, help_text=u'链接')
79 109
 
110
+    factory_yuan = models.FloatField(_(u'factory_yuan'), default=1000, help_text=u'出厂价(元)')
111
+    factory_fee = models.IntegerField(_(u'factory_fee'), default=100000, help_text=u'出厂价(分)')
112
+
80 113
     integral = models.IntegerField(_(u'integral'), default=100, help_text=u'积分')
81 114
 
82 115
     position = models.IntegerField(_(u'position'), default=1, help_text=u'排序')
@@ -171,6 +204,32 @@ class DistributorInfo(BaseModelMixin):
171 204
         }
172 205
 
173 206
 
207
+class BrandModelDistributorPriceInfo(BaseModelMixin):
208
+    brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True)
209
+    brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称')
210
+
211
+    model_id = models.CharField(_(u'model_id'), max_length=32, blank=True, null=True, help_text=u'型号唯一标识', db_index=True)
212
+    model_name = models.CharField(_(u'model_name'), max_length=255, blank=True, null=True, help_text=u'型号名称')
213
+
214
+    distributor_id = models.CharField(_(u'distributor_id'), max_length=32, blank=True, null=True, help_text=u'经销商唯一标识', db_index=True)
215
+    distributor_name = models.CharField(_(u'distributor_name'), max_length=255, blank=True, null=True, help_text=u'经销商名称')
216
+
217
+    factory_yuan = models.FloatField(_(u'factory_yuan'), default=1000, help_text=u'出厂价(元)')
218
+    factory_fee = models.IntegerField(_(u'factory_fee'), default=100000, help_text=u'出厂价(分)')
219
+
220
+    integral = models.IntegerField(_(u'integral'), default=100, help_text=u'积分')
221
+
222
+    class Meta:
223
+        verbose_name = _(u'型号/代理商价格信息')
224
+        verbose_name_plural = _(u'型号/代理商价格信息')
225
+        unique_together = (
226
+            ('brand_id', 'model_id', 'distributor_id'),
227
+        )
228
+
229
+    def __unicode__(self):
230
+        return unicode(self.pk)
231
+
232
+
174 233
 class LatestAppInfo(BaseModelMixin):
175 234
     latest_adr_version_code = models.IntegerField(_(u'latest_adr_version_code'), default=0, help_text=u'最新安卓版本号')
176 235
     latest_adr_version_name = models.CharField(_(u'latest_adr_version_name'), max_length=16, blank=True, null=True, help_text=u'最新安卓版本名')

+ 1 - 0
requirements.txt

@@ -31,6 +31,7 @@ hiredis==0.2.0
31 31
 isoweek==1.3.3
32 32
 jsonfield==2.0.2
33 33
 mock==2.0.0
34
+monetary==1.0.1
34 35
 pysnippets==1.0.5
35 36
 pywe-jssdk==1.1.0
36 37
 pywe-membercard==1.0.0

kodo - Gogs: Go Git Service

Nav apraksta

Brightcells: 21b4a5403a add api lensman_brief_api 9 gadi atpakaļ
..
__init__.py 7d85bed0b0 move errno_utils.py/response_utils.py into error file 10 gadi atpakaļ
errno_utils.py 6626af8a8d add api lensman_wx_authorize_api 10 gadi atpakaļ
response_utils.py 21b4a5403a add api lensman_brief_api 9 gadi atpakaļ