getPrDataById($_POST["id"]); if($prData){ $channelPower = $channel->getPower($prData["channel"]); if($channelPower>=20){ $dest = $db_sent->getSent($prData["book"],$prData["paragraph"],$prData["begin"],$prData["end"],$prData["channel"]); $newData = $prData; if($dest){ #更新 $newData["id"]=$dest["id"]; $newData["modify_time"]=mTime(); $newData["landmark"]=""; $updateDate[] = $newData; $insertHistoray[] = $newData; } else{ #插入 $newData["id"]=UUID::v4();; $newData["modify_time"]=mTime(); $newData["landmark"]=""; $insertData[] = $newData; $insertHistoray[] = $newData; } if($db_sent->update($updateDate)){ $respond['update'] = count($updateDate); } else{ $respond['message'] = $db_sent->getError(); $respond['status'] = 1; } if($db_sent->insert($insertData)){ $respond['insert'] = count($insertData); }else{ $respond['message'] = $db_sent->getError(); $respond['status'] = 1; } if($db_sent->historay($insertHistoray)){ $respond['historay'] = count($insertHistoray); }else{ $respond['message'] = $db_sent->getError(); $respond['status'] = 1; } } else{ $output["error"]=1; $output["message"]="没有写入权限"; } } echo json_encode($respond, JSON_UNESCAPED_UNICODE); ?>