dever 6 년 전
부모
커밋
77e25a6daa
1개의 변경된 파일27개의 추가작업 그리고 0개의 파일을 삭제
  1. 27 0
      applet/src/Msg.php

+ 27 - 0
applet/src/Msg.php

@@ -98,6 +98,33 @@ class Msg
 		}
 	}
 
+	public function submit()
+	{
+		# 立刻发送
+		$id = Dever::input('id');
+		if ($id > 0) {
+			$info = Dever::db('applet/msg_send')->one($id);
+			if ($info) {
+				Dever::setInput('key', $info['key']);
+				Dever::setInput('project_id', $info['project_id']);
+				Dever::setInput('page', $info['page']);
+				$data = json_decode(base64_decode($info['content']), true);
+				if ($data) {
+					$send = array();
+					foreach ($data as $k => $v) {
+						$send[$v['key']] = $v['value'];
+					}
+					$send = json_encode($send);
+					Dever::setInput('data', $send);
+				}
+
+				$this->sendMul();
+			}
+		}
+		Dever::alert('提交成功,请到模板消息日志中查看发送记录');
+		return;
+	}
+
 	# 发送多条模板消息 入队
 	public function sendMul()
 	{