mybatis多表查询多字段接收问题

时间:2024-11-20 07:52:17
$.ajax({ url: url, data: {butler_id: butlerId}, type: "GET", dataType: "json", async: true, success: function (data) { console.log(data) if(data.code==200){ let result = data.data; if(result.length>0){ let totalStr = ""; let selectArr = []; for(let j=0;j<result.length;j++){ let month = parseInt((result[j].in_time).slice(5,7)); console.log(month); if(start<=month&&month<=end){ selectArr.push(result[j]); } } console.log(selectArr); let arrStart = (page-1)*10; let arrEnd = (page-1)*10+10; if(arrEnd>selectArr.length){ arrEnd = selectArr.length; } totalPage = Math.ceil(selectArr.length/10) let resultArr = selectArr.slice(arrStart,arrEnd); for(let i=0;i<resultArr.length;i++){ // let date = (resultArr[i].in_time).slice(0,10); // let time = (resultArr[i].in_time).slice(11,19); let formatDate = new Date(resultArr[i].in_time) let date = formatDate.getFullYear() + '-' + (formatDate.getMonth() + 1) + '-' + formatDate.getDate() let time = formatDate.getHours() + ':' + formatDate.getMinutes() + ':' + formatDate.getSeconds() let state = "成功开通"; let stateClass = "badge_success"; if(resultArr[i].order_id==null){ state = "处理中"; stateClass = "badge_unfinish"; } let sonStr = '<div style="width:100%;">\n' + ' <div class="content1">'+date+'</div>\n' + ' <div class="content2">'+time+'</div>\n' + ' <div class="content3">'+resultArr[i].user_id+'</div>\n' + ' <div class="content2">\n' + ' <div class="'+stateClass+'">'+state+'</div>\n' + ' </div>\n' + ' </div>'; totalStr = totalStr + sonStr; } $("#content").html(totalStr); }else{ alert("暂时没有数据!"); $("#content").html(""); } } $("#loading").css("display","none"); } })