|
@@ -50,7 +50,7 @@ class CloudStorageView(View):
|
|
|
''' API '''
|
|
|
logger.info('---- this user id:{},dict{}'.format(userID, request_dict))
|
|
|
if operation == 'get/info':
|
|
|
- return self.check_stock_user(userID, response)
|
|
|
+ return self.check_stock_user(userID, request_dict, response)
|
|
|
if operation == 'cloud/answer/save':
|
|
|
ip = CommonService.get_ip_address(request)
|
|
|
return self.answer_save(userID, ip, request_dict, response)
|
|
@@ -60,11 +60,12 @@ class CloudStorageView(View):
|
|
|
return self.entrance_cloud_storage_icon(userID, request_dict, response)
|
|
|
return response.json(0)
|
|
|
|
|
|
- def check_stock_user(self, user_id, response):
|
|
|
+ def check_stock_user(self, user_id, request_dict, response):
|
|
|
order = Order_Model.objects.filter(userID=user_id, status=1, order_type=0)
|
|
|
if not order.exists() and order.count() == 0:
|
|
|
return response.json(10030)
|
|
|
try:
|
|
|
+ lang = request_dict.get('lang', 'en')
|
|
|
no = '01'
|
|
|
surveys = Surveys.objects.filter(no=no, user_type=1)
|
|
|
if not surveys.exists():
|
|
@@ -88,7 +89,7 @@ class CloudStorageView(View):
|
|
|
'endTime': result.end_time,
|
|
|
'isShow': 0 if close else result.is_show,
|
|
|
'isSubmit': submit,
|
|
|
- 'page': '/surveys?token=' if result.is_show == 1 else ''
|
|
|
+ 'page': '/surveys?lang=' + lang + '&token=' if result.is_show == 1 else ''
|
|
|
}
|
|
|
localTime = int(time.time())
|
|
|
if result.start_time <= localTime <= result.end_time:
|
|
@@ -196,8 +197,8 @@ class CloudStorageView(View):
|
|
|
try:
|
|
|
if status == 3: #
|
|
|
cloud_vod_surveys_Operate_qs = CloudVodSurveysOperateLog.objects.filter(user_id=userID, status=status,
|
|
|
- created_time__gte=start_time,
|
|
|
- created_time__lte=end_time)
|
|
|
+ created_time__gte=start_time,
|
|
|
+ created_time__lte=end_time)
|
|
|
if not cloud_vod_surveys_Operate_qs.exists(): # 判断用户当天是否查阅问卷
|
|
|
cls.cloud_vob_operate_log_save(status=status, userId=userID)
|
|
|
else:
|