+def complement_code_list(request):
+ user_id = request.POST.get('user_id', '')
+ page = request.POST.get('page', 1)
+ num = request.POST.get('num', 20)
+
+ logs = ComplementCodeLogInfo.objects.filter(user_id=user_id, status=True).order_by('-pk')
+
+ logs, left = pagination(logs, page, num)
+ logs = [log.admindata for log in logs]
+
+ return response(200, 'Get Complement Code List Success', u'获取补码列表成功', data={
+ 'logs': logs,
+ 'left': left,
+ })
@@ -356,11 +356,11 @@ def consumer_info_api(request): |
||
| 356 | 356 |
submit_pk=log.pk, |
| 357 | 357 |
) |
| 358 | 358 |
|
| 359 |
- #更新注册时间 |
|
| 359 |
+ # 更新注册时间 |
|
| 360 | 360 |
if not dupload: |
| 361 | 361 |
user.resgister_at = log.created_at |
| 362 | 362 |
user.save() |
| 363 |
- |
|
| 363 |
+ |
|
| 364 | 364 |
if not user.test_user and not dupload: |
| 365 | 365 |
|
| 366 | 366 |
# TODO: Make statistic async |
@@ -453,7 +453,7 @@ def consumer_info_api(request): |
||
| 453 | 453 |
user.integral += model.shot_member_integral |
| 454 | 454 |
# 配件不增加会员等级,只发放积分。 |
| 455 | 455 |
to_send_coupon = False |
| 456 |
- if user.level < UserInfo.MEMBER_BLACK_GOLD and model.category != '调焦器' and model.category !='增倍镜': |
|
| 456 |
+ if user.level < UserInfo.MEMBER_BLACK_GOLD and model.category != '调焦器' and model.category != '增倍镜': |
|
| 457 | 457 |
user.level += 1 |
| 458 | 458 |
to_send_coupon = True |
| 459 | 459 |
user.save() |
@@ -491,6 +491,7 @@ def consumer_snlist_api(request): |
||
| 491 | 491 |
'logs': logs, |
| 492 | 492 |
}) |
| 493 | 493 |
|
| 494 |
+ |
|
| 494 | 495 |
@logit(res=True) |
| 495 | 496 |
@transaction.atomic |
| 496 | 497 |
def consumer_model_list(request): |
@@ -501,11 +502,11 @@ def consumer_model_list(request): |
||
| 501 | 502 |
user = UserInfo.objects.get(user_id=user_id) |
| 502 | 503 |
except UserInfo.DoesNotExist: |
| 503 | 504 |
return response(UserStatusCode.USER_NOT_FOUND) |
| 504 |
- |
|
| 505 |
- #返回型号列表 |
|
| 505 |
+ |
|
| 506 |
+ # 返回型号列表 |
|
| 506 | 507 |
models = ModelInfo.objects.filter(shot_type_id__isnull=False, status=True).order_by('-shot_member_name')
|
| 507 | 508 |
models = [model.consumer_shot_data for model in models] |
| 508 |
- |
|
| 509 |
+ |
|
| 509 | 510 |
return response(200, 'Get Model List Success', u'获取型号列表成功', {
|
| 510 | 511 |
'models': models, |
| 511 |
- }) |
|
| 512 |
+ }) |
@@ -71,7 +71,7 @@ def exec_del_clerk_sale_submit(pk, admin_id): |
||
| 71 | 71 |
clerk.total_integral -= integral |
| 72 | 72 |
clerk.save() |
| 73 | 73 |
|
| 74 |
- #记录删除日志 |
|
| 74 |
+ # 记录删除日志 |
|
| 75 | 75 |
StaffDeleteClerkSaleSubmitLogInfo.objects.create( |
| 76 | 76 |
admin_id=admin_id, |
| 77 | 77 |
log_pk=pk, |
@@ -239,6 +239,7 @@ def del_clerk_sale_submit_api(request): |
||
| 239 | 239 |
|
| 240 | 240 |
return response(200, 'Del Success', u'删除成功') |
| 241 | 241 |
|
| 242 |
+ |
|
| 242 | 243 |
@logit |
| 243 | 244 |
@transaction.atomic |
| 244 | 245 |
def batch_del_clerk_sale_submit_api(request): |
@@ -290,8 +291,8 @@ def exec_del_consumer_submit(pk, admin_id): |
||
| 290 | 291 |
user = UserInfo.objects.select_for_update().get(user_id=ssli.user_id) |
| 291 | 292 |
except UserInfo.DoesNotExist: |
| 292 | 293 |
return response() |
| 293 |
- |
|
| 294 |
- #记录删除日志 |
|
| 294 |
+ |
|
| 295 |
+ # 记录删除日志 |
|
| 295 | 296 |
StaffDeleteConsumerSubmitLogInfo.objects.create( |
| 296 | 297 |
admin_id=admin_id, |
| 297 | 298 |
log_pk=pk, |
@@ -505,8 +506,8 @@ def batch_del_consumer_submit_api(request): |
||
| 505 | 506 |
administrator = AdministratorInfo.objects.get(admin_id=admin_id, user_status=AdministratorInfo.ACTIVATED, status=True) |
| 506 | 507 |
except AdministratorInfo.DoesNotExist: |
| 507 | 508 |
return response(AdministratorStatusCode.ADMINISTRATOR_NOT_FOUND) |
| 508 |
- |
|
| 509 |
+ |
|
| 509 | 510 |
for pk in pks: |
| 510 | 511 |
exec_del_consumer_submit(pk, admin_id) |
| 511 | 512 |
|
| 512 |
- return response(200, 'Del Success', u'删除成功') |
|
| 513 |
+ return response(200, 'Del Success', u'删除成功') |
@@ -3,15 +3,12 @@ |
||
| 3 | 3 |
from django.conf.urls import url |
| 4 | 4 |
from django_file_upload import views as file_views |
| 5 | 5 |
|
| 6 |
-from account import views as account_views |
|
| 7 |
-from api import (admin_views, clerk_views, distributor_views, encrypt_views, log_views, mch_views, member_views, |
|
| 6 |
+from api import (admin_views, clerk_views, complement_views, distributor_views, encrypt_views, log_views, mch_views, member_views, |
|
| 8 | 7 |
model_views, operator_views, refresh_views, sr_views, staff_views, wx_views) |
| 9 | 8 |
from miniapp import qy_views |
| 10 | 9 |
from miniapp import views as mini_views |
| 11 |
-from operation import views as op_views |
|
| 12 | 10 |
from page import oauth_views, sale_views, screen_views |
| 13 | 11 |
from sales import views as sales_views |
| 14 |
-from server import server_views |
|
| 15 | 12 |
from statistic import views as tj_views |
| 16 | 13 |
|
| 17 | 14 |
# Mini App |
@@ -163,13 +160,13 @@ urlpatterns += [ |
||
| 163 | 160 |
url(r'^admin/member/goods/order$', admin_views.member_goods_order, name='member_goods_order'), |
| 164 | 161 |
url(r'^admin/member/goods/order/update$', admin_views.member_goods_order_update, name='member_goods_order_update'), |
| 165 | 162 |
url(r'^admin/member/goods/order/batch/update$', admin_views.member_goods_order_batch_update, name='member_goods_order_batch_update'), |
| 166 |
- |
|
| 163 |
+ |
|
| 167 | 164 |
url(r'^admin/member/activity/list$', admin_views.member_activity_list, name='member_activity_list'), |
| 168 | 165 |
url(r'^admin/member/activity/details$', admin_views.member_activity_details, name='member_activity_details'), |
| 169 | 166 |
url(r'^admin/member/activity/update$', admin_views.member_activity_update, name='member_activity_update'), |
| 170 | 167 |
url(r'^admin/member/activity/create$', admin_views.member_activity_create, name='member_activity_create'), |
| 171 | 168 |
url(r'^admin/member/activity/share/list$', admin_views.member_activity_share_list, name='member_activity_share_list'), |
| 172 |
- |
|
| 169 |
+ |
|
| 173 | 170 |
url(r'^admin/coupon/list$', admin_views.coupon_list, name='coupon_list'), |
| 174 | 171 |
url(r'^admin/coupon/details$', admin_views.coupon_details, name='coupon_update'), |
| 175 | 172 |
url(r'^admin/coupon/create$', admin_views.coupon_create, name='coupon_create'), |
@@ -240,3 +237,8 @@ urlpatterns += [ |
||
| 240 | 237 |
urlpatterns += [ |
| 241 | 238 |
url(r'^get_limit_scene_qrcode_url$', wx_views.get_limit_scene_qrcode_url, name='get_limit_scene_qrcode_url'), |
| 242 | 239 |
] |
| 240 |
+ |
|
| 241 |
+urlpatterns += [ |
|
| 242 |
+ url(r'^complement/code$', complement_views.complement_code, name='complement_code'), |
|
| 243 |
+ url(r'^complement/code/list$', complement_views.complement_code_list, name='complement_code_list'), |
|
| 244 |
+] |
@@ -56,7 +56,7 @@ class CouponInfo(BaseModelMixin): |
||
| 56 | 56 |
if self.coupon_expire_type == CouponInfo.FIXED_EXPIRED_TIME: |
| 57 | 57 |
return self.coupon_expire_at |
| 58 | 58 |
return tc.utc_datetime(days=self.coupon_valid_period) |
| 59 |
- |
|
| 59 |
+ |
|
| 60 | 60 |
@property |
| 61 | 61 |
def admindata(self): |
| 62 | 62 |
return {
|
@@ -71,7 +71,7 @@ class CouponInfo(BaseModelMixin): |
||
| 71 | 71 |
'is_coupon_admin_writeoff': self.is_coupon_admin_writeoff, |
| 72 | 72 |
'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d %H:%M:%S'), |
| 73 | 73 |
} |
| 74 |
- |
|
| 74 |
+ |
|
| 75 | 75 |
@property |
| 76 | 76 |
def admindetails(self): |
| 77 | 77 |
return {
|
@@ -3,7 +3,7 @@ |
||
| 3 | 3 |
from django.contrib import admin |
| 4 | 4 |
from django_admin import ReadOnlyModelAdmin |
| 5 | 5 |
|
| 6 |
-from logs.models import MchInfoDecryptLogInfo, MchInfoEncryptLogInfo, MchLogInfo, MchSearchModelAndCameraLogInfo |
|
| 6 |
+from logs.models import MchInfoDecryptLogInfo, MchInfoEncryptLogInfo, MchLogInfo, MchSearchModelAndCameraLogInfo, ComplementCodeLogInfo |
|
| 7 | 7 |
|
| 8 | 8 |
|
| 9 | 9 |
class MchInfoEncryptLogInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin): |
@@ -22,18 +22,18 @@ class MchLogInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin): |
||
| 22 | 22 |
search_fields = ('operator_id', 'app_version')
|
| 23 | 23 |
|
| 24 | 24 |
|
| 25 |
-class MchLogInfoAdmin(ReadOnlyModelAdmin, admin.ModelAdmin): |
|
| 26 |
- list_display = ('log_id', 'log_file', 'operator_id', 'app_version', 'status', 'created_at', 'updated_at')
|
|
| 27 |
- list_filter = ('operator_id', 'app_version', 'status')
|
|
| 28 |
- search_fields = ('operator_id', 'app_version')
|
|
| 29 |
- |
|
| 30 |
- |
|
| 31 | 25 |
class MchSearchModelAndCameraLogInfoAdmin(admin.ModelAdmin): |
| 32 | 26 |
list_display = ('user_id', 'is_search_model', 'is_selected_model', 'is_search_camera', 'is_search_model_camera', 'is_search_camera_after_model', 'created_at')
|
| 33 | 27 |
list_filter = ('is_search_model', 'is_selected_model', 'is_search_camera', 'is_search_model_camera', 'is_search_camera_after_model')
|
| 34 | 28 |
|
| 35 | 29 |
|
| 30 |
+class ComplementCodeLogInfoAdmin(admin.ModelAdmin): |
|
| 31 |
+ list_display = ('user_id', 'log_id', 'name', 'phone', 'model_id', 'model_name', 'sn', 'shot_image', 'invoice_image', 'status', 'created_at', 'updated_at')
|
|
| 32 |
+ list_filter = ('model_id', 'status')
|
|
| 33 |
+ |
|
| 34 |
+ |
|
| 36 | 35 |
admin.site.register(MchInfoDecryptLogInfo, MchInfoDecryptLogInfoAdmin) |
| 37 | 36 |
admin.site.register(MchInfoEncryptLogInfo, MchInfoEncryptLogInfoAdmin) |
| 38 | 37 |
admin.site.register(MchSearchModelAndCameraLogInfo, MchSearchModelAndCameraLogInfoAdmin) |
| 39 | 38 |
admin.site.register(MchLogInfo, MchLogInfoAdmin) |
| 39 |
+admin.site.register(ComplementCodeLogInfo, ComplementCodeLogInfoAdmin) |
@@ -0,0 +1,39 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+# Generated by Django 1.11.29 on 2021-01-04 07:47 |
|
| 3 |
+from __future__ import unicode_literals |
|
| 4 |
+ |
|
| 5 |
+from django.db import migrations, models |
|
| 6 |
+import django_models_ext.fileext |
|
| 7 |
+import shortuuidfield.fields |
|
| 8 |
+ |
|
| 9 |
+ |
|
| 10 |
+class Migration(migrations.Migration): |
|
| 11 |
+ |
|
| 12 |
+ dependencies = [ |
|
| 13 |
+ ('logs', '0012_auto_20201130_0131'),
|
|
| 14 |
+ ] |
|
| 15 |
+ |
|
| 16 |
+ operations = [ |
|
| 17 |
+ migrations.CreateModel( |
|
| 18 |
+ name='ComplementCodeLogInfo', |
|
| 19 |
+ fields=[ |
|
| 20 |
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
| 21 |
+ ('status', models.BooleanField(default=True, help_text='Status', verbose_name='status')),
|
|
| 22 |
+ ('created_at', models.DateTimeField(auto_now_add=True, help_text='Create Time', verbose_name='created_at')),
|
|
| 23 |
+ ('updated_at', models.DateTimeField(auto_now=True, help_text='Update Time', verbose_name='updated_at')),
|
|
| 24 |
+ ('user_id', models.CharField(blank=True, db_index=True, help_text='\u7528\u6237\u552f\u4e00\u6807\u8bc6', max_length=32, null=True, verbose_name='user_id')),
|
|
| 25 |
+ ('log_id', shortuuidfield.fields.ShortUUIDField(blank=True, db_index=True, editable=False, help_text='\u65e5\u5fd7\u552f\u4e00\u6807\u8bc6', max_length=22)),
|
|
| 26 |
+ ('name', models.CharField(blank=True, help_text='\u7528\u6237\u59d3\u540d', max_length=255, null=True, verbose_name='name')),
|
|
| 27 |
+ ('phone', models.CharField(blank=True, db_index=True, help_text='\u7528\u6237\u7535\u8bdd', max_length=11, null=True, verbose_name='phone')),
|
|
| 28 |
+ ('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')),
|
|
| 29 |
+ ('model_name', models.CharField(blank=True, help_text='\u578b\u53f7\u540d\u79f0', max_length=255, null=True, verbose_name='model_name')),
|
|
| 30 |
+ ('sn', models.CharField(blank=True, db_index=True, help_text='\u5e8f\u5217\u53f7', max_length=32, null=True, verbose_name='sn')),
|
|
| 31 |
+ ('shot_image', models.ImageField(blank=True, help_text='\u955c\u5934\u673a\u8eab\u7167\u7247', null=True, upload_to=django_models_ext.fileext.upload_path, verbose_name='shot_image')),
|
|
| 32 |
+ ('invoice_image', models.ImageField(blank=True, help_text='\u8d2d\u4e70\u51ed\u8bc1\u7167\u7247', null=True, upload_to=django_models_ext.fileext.upload_path, verbose_name='invoice_image')),
|
|
| 33 |
+ ], |
|
| 34 |
+ options={
|
|
| 35 |
+ 'verbose_name': '\u8865\u7801\u8bb0\u5f55', |
|
| 36 |
+ 'verbose_name_plural': '\u8865\u7801\u8bb0\u5f55', |
|
| 37 |
+ }, |
|
| 38 |
+ ), |
|
| 39 |
+ ] |
@@ -113,3 +113,27 @@ class MchSearchModelAndCameraLogInfo(BaseModelMixin): |
||
| 113 | 113 |
|
| 114 | 114 |
def __unicode__(self): |
| 115 | 115 |
return '%d' % self.pk |
| 116 |
+ |
|
| 117 |
+ |
|
| 118 |
+class ComplementCodeLogInfo(BaseModelMixin): |
|
| 119 |
+ user_id = models.CharField(_(u'user_id'), max_length=32, blank=True, null=True, help_text=u'用户唯一标识', db_index=True) |
|
| 120 |
+ |
|
| 121 |
+ log_id = ShortUUIDField(_(u'log_id'), max_length=32, help_text=u'日志唯一标识', db_index=True) |
|
| 122 |
+ |
|
| 123 |
+ name = models.CharField(_(u'name'), max_length=255, blank=True, null=True, help_text=u'用户姓名') |
|
| 124 |
+ phone = models.CharField(_(u'phone'), max_length=11, blank=True, null=True, help_text=u'用户电话', db_index=True) |
|
| 125 |
+ |
|
| 126 |
+ model_id = models.CharField(_(u'model_id'), max_length=32, blank=True, null=True, help_text=u'型号唯一标识', db_index=True) |
|
| 127 |
+ model_name = models.CharField(_(u'model_name'), max_length=255, blank=True, null=True, help_text=u'型号名称') |
|
| 128 |
+ |
|
| 129 |
+ sn = models.CharField(_(u'sn'), max_length=32, blank=True, null=True, help_text=u'序列号', db_index=True) |
|
| 130 |
+ |
|
| 131 |
+ shot_image = models.ImageField(_(u'shot_image'), upload_to=upload_path, blank=True, null=True, help_text=u'镜头机身照片') |
|
| 132 |
+ invoice_image = models.ImageField(_(u'invoice_image'), upload_to=upload_path, blank=True, null=True, help_text=u'购买凭证照片') |
|
| 133 |
+ |
|
| 134 |
+ class Meta: |
|
| 135 |
+ verbose_name = _(u'补码记录') |
|
| 136 |
+ verbose_name_plural = _(u'补码记录') |
|
| 137 |
+ |
|
| 138 |
+ def __unicode__(self): |
|
| 139 |
+ return '%d' % self.pk |
@@ -11,6 +11,7 @@ from TimeConvert import TimeConvert as tc |
||
| 11 | 11 |
|
| 12 | 12 |
from coupon.models import CouponInfo |
| 13 | 13 |
|
| 14 |
+ |
|
| 14 | 15 |
class AdministratorInfo(BaseModelMixin): |
| 15 | 16 |
ADMINISTRATOR = 0 |
| 16 | 17 |
MAINTENANCE = 1 |
@@ -259,7 +260,7 @@ class ModelInfo(BaseModelMixin): |
||
| 259 | 260 |
'shot_image': self.shot_member_image_url, |
| 260 | 261 |
'integral': self.shot_member_integral, |
| 261 | 262 |
} |
| 262 |
- |
|
| 263 |
+ |
|
| 263 | 264 |
@property |
| 264 | 265 |
def consumer_shot_data(self): |
| 265 | 266 |
from member.models import ShotTypeInfo |
@@ -276,6 +277,7 @@ class ModelInfo(BaseModelMixin): |
||
| 276 | 277 |
'shot_type_name': shot_type.shot_type_name |
| 277 | 278 |
} |
| 278 | 279 |
|
| 280 |
+ |
|
| 279 | 281 |
class ModelImageInfo(BaseModelMixin): |
| 280 | 282 |
model_id = models.CharField(_(u'model_id'), max_length=32, blank=True, null=True, help_text=u'型号唯一标识', db_index=True) |
| 281 | 283 |
model_name = models.CharField(_(u'model_name'), max_length=255, blank=True, null=True, help_text=u'型号名称') |
@@ -102,7 +102,7 @@ class GoodsInfo(BaseModelMixin): |
||
| 102 | 102 |
def admindata(self): |
| 103 | 103 |
try: |
| 104 | 104 |
coupon = CouponInfo.objects.get(coupon_id=self.coupon_id).admindata |
| 105 |
- except: |
|
| 105 |
+ except CouponInfo.DoesNotExist: |
|
| 106 | 106 |
coupon = {}
|
| 107 | 107 |
return {
|
| 108 | 108 |
'good_id': self.good_id, |
@@ -119,12 +119,12 @@ class GoodsInfo(BaseModelMixin): |
||
| 119 | 119 |
'coupon': coupon, |
| 120 | 120 |
'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d %H:%M:%S'), |
| 121 | 121 |
} |
| 122 |
- |
|
| 122 |
+ |
|
| 123 | 123 |
@property |
| 124 | 124 |
def admindetails(self): |
| 125 | 125 |
try: |
| 126 | 126 |
coupon = CouponInfo.objects.get(coupon_id=self.coupon_id).admindata |
| 127 |
- except: |
|
| 127 |
+ except CouponInfo.DoesNotExist: |
|
| 128 | 128 |
coupon = {}
|
| 129 | 129 |
return {
|
| 130 | 130 |
'good_id': self.good_id, |
@@ -143,6 +143,7 @@ class GoodsInfo(BaseModelMixin): |
||
| 143 | 143 |
'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d %H:%M:%S'), |
| 144 | 144 |
} |
| 145 | 145 |
|
| 146 |
+ |
|
| 146 | 147 |
class GoodsOrderInfo(BaseModelMixin): |
| 147 | 148 |
PHYSICAL = 0 |
| 148 | 149 |
VIRTUAL = 1 |
@@ -456,7 +457,7 @@ class MemberActivityInfo(BaseModelMixin): |
||
| 456 | 457 |
'is_signed': self.is_signed(user_id), |
| 457 | 458 |
'is_signup': self.is_signup, |
| 458 | 459 |
} |
| 459 |
- |
|
| 460 |
+ |
|
| 460 | 461 |
@property |
| 461 | 462 |
def admindata(self): |
| 462 | 463 |
return {
|
@@ -482,7 +483,7 @@ class MemberActivityInfo(BaseModelMixin): |
||
| 482 | 483 |
'activity_state': self.activity_state, |
| 483 | 484 |
'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d %H:%M:%S'), |
| 484 | 485 |
} |
| 485 |
- |
|
| 486 |
+ |
|
| 486 | 487 |
@property |
| 487 | 488 |
def admindetails(self): |
| 488 | 489 |
return {
|
@@ -585,7 +586,7 @@ class MemberActivityGroupShareInfo(BaseModelMixin): |
||
| 585 | 586 |
class Meta: |
| 586 | 587 |
verbose_name = _(u'会员活动群组分享信息') |
| 587 | 588 |
verbose_name_plural = _(u'会员活动群组分享信息') |
| 588 |
- |
|
| 589 |
+ |
|
| 589 | 590 |
unique_together = ( |
| 590 | 591 |
('activity_id', 'share_user_id', 'click_user_id', 'open_gid', 'brand_id'),
|
| 591 | 592 |
) |
@@ -248,6 +248,7 @@ def membercard_extradata(request): |
||
| 248 | 248 |
|
| 249 | 249 |
return response(200, 'Get extraData Success', u'获取 extraData 成功', extraData) |
| 250 | 250 |
|
| 251 |
+ |
|
| 251 | 252 |
@logit |
| 252 | 253 |
@transaction.atomic |
| 253 | 254 |
def user_integral_add(request): |
@@ -276,5 +277,3 @@ def user_integral_add(request): |
||
| 276 | 277 |
user.save() |
| 277 | 278 |
|
| 278 | 279 |
return response(200, 'Add User Integral Success', u'添加用户投稿积分成功') |
| 279 |
- |
|
| 280 |
- |
@@ -68,6 +68,7 @@ def online_api(request): |
||
| 68 | 68 |
'online': app_settings.get('online', True),
|
| 69 | 69 |
}) |
| 70 | 70 |
|
| 71 |
+ |
|
| 71 | 72 |
@logit |
| 72 | 73 |
def splash_api(request): |
| 73 | 74 |
""" 启动页面 """ |
@@ -11,6 +11,7 @@ from mch.models import BrandInfo, DistributorInfo, SaleclerkInfo |
||
| 11 | 11 |
from utils.error.errno_utils import ProductBrandStatusCode, ProductDistributorStatusCode, SaleclerkStatusCode |
| 12 | 12 |
from utils.redis.connect import r |
| 13 | 13 |
|
| 14 |
+ |
|
| 14 | 15 |
def login_qrcode(request): |
| 15 | 16 |
lensman_type = int(request.GET.get('lt') or 0)
|
| 16 | 17 |
unionid = request.GET.get('unionid', '')
|
@@ -577,7 +577,7 @@ def clerk_checkout_serialNo_api(request): |
||
| 577 | 577 |
except SaleclerkInfo.DoesNotExist: |
| 578 | 578 |
return response(SaleclerkStatusCode.CLERK_NOT_FOUND) |
| 579 | 579 |
|
| 580 |
- log = MchInfoEncryptLogInfo.objects.filter(model_pk=model_pk, sn=serialNo).order_by('-created_at')
|
|
| 580 |
+ log = MchInfoEncryptLogInfo.objects.filter(model_pk=model_pk, sn=serialNo).order_by('-pk')
|
|
| 581 | 581 |
|
| 582 | 582 |
if not log: |
| 583 | 583 |
return response(ProductMachineStatusCode.SN_NOT_FOUND) |
@@ -8,10 +8,10 @@ from staff.models import StaffDeleteClerkSaleSubmitLogInfo, StaffDeleteConsumerS |
||
| 8 | 8 |
class StaffDeleteClerkSaleSubmitLogInfoAdmin(admin.ModelAdmin): |
| 9 | 9 |
list_display = ('admin_id', 'log_pk', 'model_name', 'code', 'status', 'created_at', 'updated_at')
|
| 10 | 10 |
|
| 11 |
+ |
|
| 11 | 12 |
class StaffDeleteConsumerSubmitLogInfoAdmin(admin.ModelAdmin): |
| 12 | 13 |
list_display = ('admin_id', 'log_pk', 'model_name', 'code', 'status', 'created_at', 'updated_at')
|
| 13 | 14 |
|
| 14 | 15 |
|
| 15 | 16 |
admin.site.register(StaffDeleteClerkSaleSubmitLogInfo, StaffDeleteClerkSaleSubmitLogInfoAdmin) |
| 16 | 17 |
admin.site.register(StaffDeleteConsumerSubmitLogInfo, StaffDeleteConsumerSubmitLogInfoAdmin) |
| 17 |
- |
@@ -18,6 +18,7 @@ class StaffDeleteClerkSaleSubmitLogInfo(BaseModelMixin): |
||
| 18 | 18 |
def __unicode__(self): |
| 19 | 19 |
return '%d' % self.pk |
| 20 | 20 |
|
| 21 |
+ |
|
| 21 | 22 |
class StaffDeleteConsumerSubmitLogInfo(BaseModelMixin): |
| 22 | 23 |
admin_id = models.CharField(_(u'admin_id'), max_length=32, blank=True, null=True, help_text=u'管理员ID', db_index=True) |
| 23 | 24 |
log_pk = models.CharField(_(u'log_pk'), max_length=32, blank=True, null=True, help_text=u'消费者提交记录关联pk', db_index=True) |
@@ -99,6 +99,7 @@ class MarketCodeStatusCode(BaseStatusCode): |
||
| 99 | 99 |
""" 一物一码相关错误码 5050xx """ |
| 100 | 100 |
MARKET_CODE_NOT_FOUND = StatusCodeField(505001, 'Market Code Not Found', description=u'一物一码不存在') |
| 101 | 101 |
|
| 102 |
+ |
|
| 102 | 103 |
class AdministratorStatusCode(BaseStatusCode): |
| 103 | 104 |
""" 操作员相关错误码 4002xx """ |
| 104 | 105 |
ADMINISTRATOR_NOT_FOUND = StatusCodeField(400201, 'Administrator Not Found', description=u'管理员不存在') |
@@ -150,10 +151,12 @@ class WechatStatusCode(BaseStatusCode): |
||
| 150 | 151 |
UNIONID_NOT_FOUND = StatusCodeField(400702, 'Unionid Not Found', description=u'微信 UNIONID 不存在') |
| 151 | 152 |
OPENID_NOT_FOUND = StatusCodeField(400703, 'OPENID Not Found', description=u'微信 OPENID 不存在') |
| 152 | 153 |
|
| 154 |
+ |
|
| 153 | 155 |
class ScreenStatusCode(BaseStatusCode): |
| 154 | 156 |
""" 群组/团相关错误码 4030xx """ |
| 155 | 157 |
QRCODE_NOT_SCAN = StatusCodeField(403001, 'QRCode Not Scan', description=u'二维码未扫描') |
| 156 | 158 |
|
| 159 |
+ |
|
| 157 | 160 |
class PermissionStatusCode(BaseStatusCode): |
| 158 | 161 |
""" 4099xx 权限相关错误码 """ |
| 159 | 162 |
PERMISSION_DENIED = StatusCodeField(409900, 'Permission Denied', description=u'权限不足') |