일간매출현황 완료 된것만 출력하고 싶은데... 질문드립니다 채택완료
영카트5 adm/shop_admin/sale1date.php에서
제가
$sql = " select od_id, SUBSTRING(od_time,1,10) as od_date, od_settle_case, od_receipt_price, od_receipt_point, od_cart_price, od_cancel_price, od_refund_price, od_misu, (od_cart_price + od_send_cost + od_send_cost2) as orderprice, (od_cart_coupon + od_coupon + od_send_coupon) as couponprice from {$g5['g5_shop_order_table']} where SUBSTRING(od_time,1,10) between '$fr_date' and '$to_date' order by od_time desc "; $result = sql_query($sql);
이 코드를
$sql = " select o.od_id, SUBSTRING(o.od_time,1,10) as od_date, o.od_settle_case, o.od_receipt_price, o.od_receipt_point, o.od_cart_price, o.od_cancel_price, o.od_refund_price, o.od_misu, (o.od_cart_price + o.od_send_cost + o.od_send_cost2) as orderprice, (o.od_cart_coupon + o.od_coupon + o.od_send_coupon) as couponprice from {$g5['g5_shop_cart_table']} c left join {$g5['g5_shop_order_table']} o on(c.od_id = o.od_id) where SUBSTRING(o.od_time,1,10) between '$fr_date' and '$to_date' and c.ct_status='완료' group by o.od_id order by o.od_time desc "; $result = sql_query($sql);
이렇게 바꿨는데
완료 된것만 나오는거 같은데
뭔가 값이 이상한거 같아서 그런데 저 sql문 저렇게 바꾸면 되는건가요?
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인