Ver Fonte

更新云存提示信息内容,未使用套餐列表月份显示区分国内外

locky há 4 anos atrás
pai
commit
06352db4d1
1 ficheiros alterados com 20 adições e 13 exclusões
  1. 20 13
      Controller/CloudStorage.py

+ 20 - 13
Controller/CloudStorage.py

@@ -34,7 +34,6 @@ from django.db import transaction
 from django.views.generic.base import View
 import jwt
 from pyfcm import FCMNotification
-
 from Ansjer.config import OSS_STS_ACCESS_KEY, OSS_STS_ACCESS_SECRET, OSS_ROLE_ARN, SERVER_DOMAIN, PAYPAL_CRD, \
     SERVER_DOMAIN_SSL, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ARN, APNS_MODE, APNS_CONFIG, BASE_DIR, \
     JPUSH_CONFIG, FCM_CONFIG, OAUTH_ACCESS_TOKEN_SECRET
@@ -787,7 +786,7 @@ class CloudStorageView(View):
 
                     order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
                     datetime = time.strftime("%Y-%m-%d", time.localtime())
-                    sys_msg_text_list = ['温馨提示:尊敬的客户,您的'+UID+'设备在'+datetime+'已成功购买云存套餐', 'Warm tips: Dear customers, your '+UID+' device has successfully purchased the cloud storage package in '+datetime]
+                    sys_msg_text_list = ['温馨提示:尊敬的客户,您的'+UID+'设备在'+datetime+'已成功购买云存套餐', 'Dear customer,you already subscribed the cloud storage package successfully for device ' + UID + ' on '+ time.strftime("%b %dth,%Y", time.localtime())]
                     self.do_vod_msg_Notice(UID, channel, userid, lang, sys_msg_text_list, 'SMS_219738485')
                     red_url = "{SERVER_DOMAIN_SSL}web/paid2/success.html".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)
                     if lang != 'cn':
@@ -895,7 +894,8 @@ class CloudStorageView(View):
                 order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
                 datetime = time.strftime("%Y-%m-%d", time.localtime())
                 sys_msg_text_list = ['温馨提示:尊敬的客户,您的' + UID + '设备在' + datetime + '已成功购买云存套餐',
-                                     'Warm tips: Dear customers, your '+UID+' device has successfully purchased the cloud storage package in '+datetime]
+                                     'Dear customer,you already subscribed the cloud storage package successfully for device ' + UID + ' on ' + time.strftime(
+                                         "%b %dth,%Y", time.localtime())]
 
                 self.do_vod_msg_Notice(UID, channel, userid, lang, sys_msg_text_list, 'SMS_219738485')
 
@@ -998,7 +998,9 @@ class CloudStorageView(View):
                     order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
                     datetime = time.strftime("%Y-%m-%d", time.localtime())
                     sys_msg_text_list = ['温馨提示:尊敬的客户,您的' + UID + '设备在' + datetime + '已成功购买云存套餐',
-                                         'Warm tips: Dear customers, your '+UID+' device has successfully purchased the cloud storage package in '+datetime]
+                                         'Dear customer,you already subscribed the cloud storage package successfully for device ' + UID + ' on ' + time.strftime(
+                                             "%b %dth,%Y", time.localtime())]
+
                     self.do_vod_msg_Notice(UID, channel, userid, lang, sys_msg_text_list, 'SMS_219738485')
                     return HttpResponse(pay.xml_to_dict({'return_code': 'SUCCESS', 'return_msg': 'OK'}))
             else:
@@ -1279,7 +1281,9 @@ class CloudStorageView(View):
                 sms = 'SMS_219738485'
                 datetime = time.strftime("%Y-%m-%d", time.localtime())
                 sys_msg_text_list = ['温馨提示:尊敬的客户,您的' + uid + '设备在' + datetime + '已成功购买云存套餐',
-                                     'Warm tips: Dear customers, your '+uid+' device has successfully purchased the cloud storage package in '+datetime]
+                                     'Dear customer,you already subscribed the cloud storage package successfully for device ' + uid + ' on ' + time.strftime(
+                                         "%b %dth,%Y", time.localtime())]
+
                 # return response.json(0)
                 returnurl = "{SERVER_DOMAIN_SSL}cloudstorage/payOK?lang={lang}".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL,lang=lang)
                 if pay_type == 10:
@@ -1290,9 +1294,9 @@ class CloudStorageView(View):
                     )
                     returnurl = "{SERVER_DOMAIN_SSL}cloudstorage/payOK?paytype=10&lang={lang}".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL,lang=lang)
                     datetime = time.strftime("%Y-%m-%d", time.localtime())
-                    sys_msg_text_list = ['温馨提示:尊敬的客户,您的' + uid + '设备在' + datetime + '已成功体验云存',
-                                         'Warm tips: respected customers, your '+uid+' device has successfully experienced cloud storage in '+datetime]
-                    sms = 'SMS_219743364'
+                    sys_msg_text_list = ['温馨提示:尊敬的客户,您的' + uid + '设备在' + datetime + '已成功开通云存体验套餐',
+                                         'Dear customer,you already subscribed the free trial cloud storage service successfully for device ' + uid + ' on '+ time.strftime("%b %dth,%Y", time.localtime())]
+                    sms = 'SMS_222870823'
                 if pay_type == 11:
                     update_dict = {}
                     update_dict['is_activate'] = 1
@@ -1302,7 +1306,7 @@ class CloudStorageView(View):
 
                     datetime = time.strftime("%Y-%m-%d", time.localtime())
                     sys_msg_text_list = ['温馨提示:尊敬的客户,您的' + uid + '设备在' + datetime + '已成功兑换云存',
-                                         'Warm tips: Dear customers, your '+uid+' device has been successfully converted to cloud deposit at '+datetime]
+                                         'Dear customer, you already redeemed for the cloud storage package successfully for device ' +uid +' on '+time.strftime("%b %dth,%Y", time.localtime())]
                     sms = 'SMS_219748439'
 
                 self.do_vod_msg_Notice(uid, channel, userID, lang, sys_msg_text_list, sms)
@@ -1376,9 +1380,12 @@ class CloudStorageView(View):
         if has_unused == 1:
             unuseds = Unused_Uid_Meal.objects.filter(uid=uid).annotate(unused_id=F('id')) \
                 .values("unused_id","uid","bucket__content","num","bucket__id","expire")
+            month = 'month' if lang != 'cn' else '个月'
             for ub in unuseds:
-                storage_time = ub['num'] *  ub['expire']
-                storage = "{storage_time}个月".format(storage_time=storage_time)
+                storage_time = ub['num'] * ub['expire']
+                if lang != 'cn' and storage_time > 1:   # 英文大于一个月使用复数
+                    month += 's'
+                storage = "{storage_time}{month}".format(storage_time=storage_time, month=month)
                 unused_dict = {
                     "id":ub['unused_id'],
                     "uid":ub['uid'],
@@ -1518,7 +1525,7 @@ class CloudStorageView(View):
                     if ub['bucket__area'] == 'cn':
                         sys_msg_text = "温馨提示:尊敬的客户,您" + ub['uid'] + "设备的云存套餐将在" + time.strftime("%Y-%m-%d", time.localtime(ub['endTime'])) + "到期"
                     else:
-                        sys_msg_text = "Warm tips: Dear customers, the cloud storage package of your " + ub['uid'] + " device will expire at " + time.strftime("%Y-%m-%d", time.localtime(ub['endTime']))
+                        sys_msg_text = 'Dear customer,the cloud storage package for your device '+ub['uid']+' will expire on '+time.strftime('%m-%d-%y',time.localtme(ub['endTime']))
                     uq_list.append(SysMsgModel(
                         userID_id=oo['userID_id'],
                         addTime=now_time,
@@ -1665,7 +1672,7 @@ class CloudStorageView(View):
 
     def sendMessage(self, phone , params, temp_msg):
             # 购买成功
-            sign_ms = 'Ansjer'
+            sign_ms = '周视'
             # 发送手机验证码
             aliSms = AliSmsObject()
             res = aliSms.send_code_sms_cloud(phone=phone, params = params, sign_name=sign_ms,