<?php include_once '../common/include-file.php'; $id = $_GET['id']; $baseId = $_GET['baseId']; $msgBase = new MsgBase(); $msgBase->delete(" id = " . $baseId); $msgNews = new MsgNews(); $msgNews->delete(" id = " . $id); header("Location:" . $CONTEXT_PATH . "/wxcms/msgnewsList.php");
<?php include '../common/include-file.php'; $msgBase = new MsgBase(); $baseData = array('msgType' => 'text', 'inputCode' => '123456', 'createTime' => date('Y-m-d')); //$baseId = $msgBase->insert($baseData); $msgBase->delete('id = 4 '); ?>
<?php include_once '../common/include-file.php'; $inputCode = $_POST['inputCode']; $id = $_POST['id']; $baseId = $_POST['baseId']; if (isset($id) && $id != '') { //更新 //msgBase $msgBase = new MsgBase(); $baseData = array('id' => $baseId, 'inputCode' => $_POST['inputCode']); $msgBase->updateById($baseData); //msgText $msgText = new MsgText(); $data = array('id' => $id, 'content' => $_POST['content']); $msgText->updateById($data); } else { //msgBase $msgBase = new MsgBase(); $baseData = array('msgType' => 'text', 'inputCode' => $_POST['inputCode'], 'createTime' => date('Y-m-d')); $baseId = $msgBase->insert($baseData); //msgText $msgText = new MsgText(); $data = array('base_id' => $baseId, 'content' => $_POST['content']); $msgText->insert($data); } header("Location:" . $CONTEXT_PATH . "/wxcms/msgtextList.php");