flow.php中哪一段语句是把订单列表写了数据库

2016-07-07 15:05 来源:www.chinab4c.com 作者:ecshop专家



下面这段代码是把购购车中的商品列表插入数据库的吗?
  1. $_POST['how_oos'] = isset($_POST['how_oos']) ? intval($_POST['how_oos']) : 0;
  2. $_POST['card_message'] = isset($_POST['card_message']) ? htmlspecialchars($_POST['card_message']) : '';
  3. $_POST['inv_type'] = !empty($_POST['inv_type']) ? htmlspecialchars($_POST['inv_type']) : '';
  4. $_POST['inv_payee'] = isset($_POST['inv_payee']) ? htmlspecialchars($_POST['inv_payee']) : '';
  5. $_POST['inv_content'] = isset($_POST['inv_content']) ? htmlspecialchars($_POST['inv_content']) : '';
  6. $_POST['postscript'] = isset($_POST['postscript']) ? htmlspecialchars($_POST['postscript']) : '';

  7. $order = array(
  8. 'shipping_id' => intval($_POST['shipping']),
  9. 'pay_id' => intval($_POST['payment']),
  10. 'pack_id' => isset($_POST['pack']) ? intval($_POST['pack']) : 0,
  11. 'card_id' => isset($_POST['card']) ? intval($_POST['card']) : 0,
  12. 'card_message' => trim($_POST['card_message']),
  13. 'surplus' => isset($_POST['surplus']) ? floatval($_POST['surplus']) : 0.00,
  14. 'integral' => isset($_POST['integral']) ? intval($_POST['integral']) : 0,
  15. 'bonus_id' => isset($_POST['bonus']) ? intval($_POST['bonus']) : 0,
  16. 'need_inv' => empty($_POST['need_inv']) ? 0 : 1,
  17. 'inv_type' => $_POST['inv_type'],
  18. 'inv_payee' => trim($_POST['inv_payee']),
  19. 'inv_content' => $_POST['inv_content'],
  20. 'postscript' => trim($_POST['postscript']),
  21. 'how_oos' => isset($_LANG['oos'][$_POST['how_oos']]) ? addslashes($_LANG['oos'][$_POST['how_oos']]) : '',
  22. 'need_insure' => isset($_POST['need_insure']) ? intval($_POST['need_insure']) : 0,
  23. 'user_id' => $_SESSION['user_id'],
  24. 'add_time' => gmtime(),
  25. 'order_status' => OS_UNCONFIRMED,
  26. 'shipping_status' => SS_UNSHIPPED,
  27. 'pay_status' => PS_UNPAYED,
  28. 'agency_id' => get_agency_by_regions(array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district']))
复制代码
数据库中哪个表是接收订单-商品列表的了?

回答:

  1. /* 插入订单商品 */
  2. $sql = "INSERT INTO " . $ecs->table('order_goods') . "( " .
  3. "order_id, goods_id, goods_name, goods_sn, goods_number, market_price, ".
  4. "goods_price, goods_attr, is_real, extension_code, parent_id, is_gift) ".
  5. " SELECT '$new_order_id', goods_id, goods_name, goods_sn, goods_number, market_price, ".
  6. "goods_price, goods_attr, is_real, extension_code, parent_id, is_gift ".
  7. " FROM " .$ecs->table('cart') .
  8. " WHERE session_id = '".SESS_ID."' AND rec_type = '$flow_type'";
  9. $db->query($sql);

复制代码


  1. $GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('order_info'), $order, 'INSERT');
复制代码


1558行