if (!$item) { header("Location: /html/404.html?005"); exit; } $sku['iteminfo'] = $item; $sku_code = $sku['sku']; $pics = ProductsPic::getSkuPics($sku_code, 'path', 'sort DESC LIMIT 0,3'); $sku['pics'] = $pics; $sku['order_num'] = OrdersProducts::getSkuAllNum($sku_code); $sku['stock'] = ProductsStock::getSkuStock($sku_code); $skus = ProductsSku::getItemSkus($item_code, "id,sku,sku_name"); $skus = ProductsSku::getProductsPic($skus); $sku['skus'] = $skus; $userid = isset($_SESSION['userid']) ? (int) $_SESSION['userid'] : 0; $history = array(); if ($userid) { $history = UsersHistory::getProductViewLog($userid, $id); } if (!$history) { $history = ProductsSku::getRand($item_code); } $history = ProductsSku::getProductsPic($history); $history = ProductsSku::getProductsItemTitle($history); ProductsSku::increase("id={$id}", 'view_num'); $log = array('op' => 'view', 'id' => $id, 'url' => Func::getCurrentURL()); $log = json_encode($log); UsersHistory::addLog($userid, ProductsSku::$module_id, $log); Templates::Assign('history', $history); Templates::Assign('sku', $sku); Templates::Display('product.html'); }
$order_bh = Orders::getOne(array('order_code' => $bh_order_code)); if ($order_bh) { $time = $order_bh['create_time']; $time = date('Y-m-d H:i:s', $time); Templates::Assign('errormsg', "订单已在 {$time} 补过一次货,不能再补货了。"); Templates::Display('error.html'); exit; } switch ($action) { case 'save': save(); break; default: $products = OrdersBH::getList("user='******' AND order_code='{$order_code}' AND status=0"); ProductsSku::getProductsPic($products); ProductsSku::getProductsItemTitle($products); //var_dump($products);exit; Templates::Assign('products', $products); Templates::Assign('productlen', count($products)); Templates::Assign('order_code', $order_code); Templates::Display('replen.html'); } function save() { $ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : array(); $order_code = isset($_REQUEST['order_code']) ? $_REQUEST['order_code'] : ''; $user_code = isset($_SESSION['user_code']) ? $_SESSION['user_code'] : ''; $bh_order_code = str_replace('SK', 'BH', $order_code); $order_bh = Orders::getOne(array('order_code' => $bh_order_code)); if ($order_bh) { $time = $order_bh['create_time'];