界面显示和response结果不一致。
红框的地方,response获取的是正确的数据,但是界面却不对。
用var_dump打印的,不一样
前端请求:
<script>
var investigationTaskId = '';
function receiveMessage(event) {
var origin = event.origin
if (origin !== "http://localhost:8082")
return;
investigationTaskId = event.data;
$.post("/member/project",{
'investigationTaskId':investigationTaskId
},function(result){})
}
$(function(){
window.addEventListener("message", receiveMessage, false);
})
</script>
后端接收和查询
$investigationTaskId = $_REQUEST['investigationTaskId'];
$sql = "SELECT a.name ,COUNT(w.pk_works_main) AS num ,a.atlas_type,a.pk_atlas_main FROM ".$Base->table('atlasmain')." a LEFT JOIN ".$Base->table('worksmain')." w ON a.pk_atlas_main = w.pk_atlas_main WHERE a.investigationTaskId='".$investigationTaskId."' AND a.pk_user_main= ".$user['pk_user_main']." GROUP BY a.pk_atlas_main ";
var_dump($investigationTaskId);
$result = $Db->query($sql);
$tp->assign("atlas",$result);
元芳怎么了