瀏覽代碼

短信定时发送

bianjunhui 2 年之前
父節點
當前提交
807053570a

+ 3 - 3
application/lib/data/adminAction.php

@@ -666,11 +666,11 @@ class AdvertAdminAction extends BaseAction{
 		    return $result;
 		}
         //插入待发送短信参数数据
-        public function add_sms_data_queue($data){
-            $sql = 'INSERT INTO `ly_sms_data_tmp` (`params_json`) VALUES ';
+        public function add_sms_data_queue($data,$showtime,$datetime){
+            $sql = 'INSERT INTO `ly_sms_data_tmp` (`params_json`,`sendtime`,`showtime`) VALUES ';
             foreach($data as $value){
                 $params_json = serialize($value);
-                $sql .= "('{$params_json}'),";
+                $sql .= "('{$params_json}','{$datetime}','{$showtime}'),";
             }
             $sql = trim($sql, ',').';';
             $result = $this->getDbEntity()->insert_sql($sql);

+ 6 - 1
application/module/ctrl/Send_sms_adminAction.class.php

@@ -27,6 +27,11 @@ class Send_sms_adminAction extends Action
 
     public function index()
     {
+        $showtime = $_POST['demo_datetime'];
+        $datetime=strtotime($showtime);
+        if(empty($datetime)){
+            $datetime=time();
+        }
         $info = $_REQUEST['info'];
         $uid = $_SESSION['user_infos']['id'];
         $fromName = '';
@@ -154,7 +159,7 @@ class Send_sms_adminAction extends Action
             }else{
                 $result = $admin->add_sms_data_queue($params_arr);
             }*/
-            $result = $admin->add_sms_data_queue($params_arr);
+            $result = $admin->add_sms_data_queue($params_arr,$showtime,$datetime);
             if ($result) {
                 $info = '短信已进入待发送队列';
             } else {

+ 77 - 8
application/module/view/send_sms_admin/index.html

@@ -1,6 +1,58 @@
 <{include file='../public/admin_header.html'}>
 <{include file='../public/admin_navi.html'}>
 <!-- Right side column. Contains the navbar and content of the page -->
+<link rel="stylesheet" type="text/css"
+	  href="https://www.jq22.com/demo/jqueryMobiscroll201803142314/css/mobiscroll.custom.min.css" />
+<script src="https://www.jq22.com/demo/jqueryMobiscroll201803142314/js/mobiscroll.custom.min.js"
+		type="text/javascript" charset="utf-8"></script>
+<style>
+	.mbsc-ios .dw {
+		top: 0 !important;
+		left: 0 !important;
+		right: 0 !important;
+		bottom: 0 !important;
+		width: 600px !important;
+		height: 300px;
+		margin: auto;
+	}
+
+	.mbsc-ios {
+		transition: .3s;
+	}
+
+	.mbsc-ios .dw-persp .dwcc {
+		padding: 30px 0;
+	}
+
+	.mbsc-ios .dwb {
+		color: transparent;
+		position: relative;
+	}
+
+	.mbsc-ios .dwbc {
+		border-bottom: 1px solid #cdcdcd;
+		background: #ebebeb;
+	}
+
+	.dwb-s::before,
+	.dwb-c::before {
+		position: absolute;
+		top: 6px;
+		color: #333;
+		font-size: 18px;
+		font-weight: 600;
+	}
+
+	.dwb-s::before {
+		content: "确定";
+		right: 10px;
+	}
+
+	.dwb-c::before {
+		content: "取消";
+		left: 10px;
+	}
+</style>
 <aside class="right-side">
 	<!-- Content Header (Page header) -->
 	<section class="content-header">
@@ -58,7 +110,13 @@
 								</select>
 							</td>
 						</tr>
+						<tr>
 
+								<td>日期时间</td>
+							<td>
+								<input type="text" id="demo_datetime" name="demo_datetime" />
+							</td>
+						</tr>
 						<tr>
 							<td>&nbsp;</td>
 							<td >
@@ -83,18 +141,29 @@
 	.form-actions li{list-style:none;width:25px;float:left;padding-bottom:8px;padding-right:5px;}
 </style>
 <script>
-	$('#treeview11').addClass('active');
-	$(".send_sms_left").addClass('active');
+
 
 	function to_submit(){
-		var template_id = $('#template_id').val();
+		var template_ids = $('#template_id').val();
 		var group_name = $('#group_name').val();
-		if(template_id==0 || group_name==0){
-			alert("请选择模板和客户");
-		}else{
-			$('#form1').submit();
-		}
+		var demo_datetime = $('#demo_datetime').val();
+		$('#form1').submit();
 	}
+
+	var theme = "ios";
+	var mode = "scroller";
+	var display = "bottom";
+	var lang = "zh";
+	$('#demo_datetime').mobiscroll().datetime({
+		theme: theme,
+		mode: mode,
+		display: display,
+		lang: lang,
+		dateFormat: "yyyy-mm-dd",
+		minDate: new Date(2000, 3, 10, 9, 22),
+		maxDate: new Date(2030, 7, 30, 15, 44),
+		stepMinute: 1
+	});
 </script>