我有2个表(orders和productOrder),我想让它们链接到列于其中的列调用orderId中,以在“ /”路由中显示。我从AJAX获得数组的问题在“ / order / new”路由页面中包含来自“ / orderproduct”路由的orderproduct表数据,我在其中选择订单表的数据,但不能同时发布它们。.
$('#save').click(function () {
var orderProduct = new Array();
$("#review-products input[type=checkbox]:checked").each(function () {
var row = $(this).closest("tr");
var message0 = row.find('#check').val();
var message1 = row.find('.name').text().trim();
var message2 = row.find('.currency').text().trim();
var message3 = row.find(".foo").val();
const result = {check: message0,name: message1,p: message2,q: message3 ,total: message2 * message3}
var hh = orderProduct.push(result);
});
$.ajax({
type: 'GET',
data: {selectedProduct: orderProduct , sumTotal: totalPrice},
url: '/order/product',
success: function (data) {
console.log(data);
}
})
})