Browse Source

云存过期短信发送测试4

lhq 4 years ago
parent
commit
c5b93fb9c9
1 changed files with 3 additions and 5 deletions
  1. 3 5
      Controller/CloudStorage.py

+ 3 - 5
Controller/CloudStorage.py

@@ -1495,10 +1495,9 @@ class CloudStorageView(View):
             for oo in oqlist:
                 if ub['id'] == oo['uid_bucket_id']:
                     if ub['bucket__area'] == 'cn':
-                        sys_msg_text = "温馨提示:尊重的客户,您" + ub['uid'] + "设备的云存套餐将在" + time.strftime("%Y-%m-%d",
-                                                                                           ub['endTime']) + "到期"
+                        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",ub['endTime'])
+                        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']))
                     uq_list.append(SysMsgModel(
                         userID_id=oo['userID_id'],
                         addTime=now_time,
@@ -1518,8 +1517,7 @@ class CloudStorageView(View):
                             S3Email().faEmail(sys_msg_text, username)
                         elif data_valid.mobile_validate(username):
                             params = u'{"devname":"' + ub['uid'] + '","submittime":"' + time.strftime("%Y-%m-%d",
-                                                                                                      ub[
-                                                                                                          'endTime']) + '"}'
+                                                                                                      time.localtime(ub['endTime'])) + '"}'
                             self.sendMessage(username, params, 'SMS_217427260')
 
                         self.pushApp(now_time, ub['uid'], ub['channel'], sys_msg_text)