function processCCOrder($idCompany){
$sql = "SELECT oi.order_items_qty * oi.order_items_price AS order_value,si.sales_item_qty * si.price AS invoice_price
FROM order_items oi,sales_items si
where oi.product_idproduct = S.product_idproduct
SELECT c.customer_name,op.*,s.salesNo,sp.salesperson_name,if(order_value != invoice_price)
FROM ORDER_PRODUCT OP
INNER JOIN customer c
ON op.customer_idcustomer = c.idcustomer
INNER JOIN sales s
ON op.idorder = s.order_idorder
INNER JOIN sales_person sp
ON op.idorder = sp.idsales_person
WHERE oi.idcompany = $idCompany";
return $sql;
}
在上面的代码中我尝试