當前位置: 首頁>>代碼示例>>PHP>>正文


PHP update_goods函數代碼示例

本文整理匯總了PHP中update_goods函數的典型用法代碼示例。如果您正苦於以下問題:PHP update_goods函數的具體用法?PHP update_goods怎麽用?PHP update_goods使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了update_goods函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: elseif

     } elseif ($_POST['type'] == 'hot') {
         /* 檢查權限 */
         admin_priv('goods_manage');
         update_goods($goods_id, 'is_hot', '1');
     } elseif ($_POST['type'] == 'not_hot') {
         /* 檢查權限 */
         admin_priv('goods_manage');
         update_goods($goods_id, 'is_hot', '0');
     } elseif ($_POST['type'] == 'move_to') {
         /* 檢查權限 */
         admin_priv('goods_manage');
         update_goods($goods_id, 'cat_id', $_POST['target_cat']);
     } elseif ($_POST['type'] == 'restore') {
         /* 檢查權限 */
         admin_priv('remove_back');
         update_goods($goods_id, 'is_delete', '0');
         /* 記錄日誌 */
         admin_log('', 'batch_restore', 'goods');
     } elseif ($_POST['type'] == 'drop') {
         /* 檢查權限 */
         admin_priv('remove_back');
         delete_goods($goods_id);
         /* 記錄日誌 */
         admin_log('', 'batch_remove', 'goods');
     }
 }
 /* 清除緩存 */
 clear_cache_files();
 if ($_POST['type'] == 'drop' || $_POST['type'] == 'restore') {
     $link[] = array('href' => 'goods.php?act=trash', 'text' => $_LANG['11_goods_trash']);
 } else {
開發者ID:netroby,項目名稱:ecshop,代碼行數:31,代碼來源:suppliers_goods.php

示例2: VALUES

         }
     }
     /* 插入貨品表 */
     $sql = "INSERT INTO " . $GLOBALS['ecs']->table('products') . " (goods_id, goods_attr, product_sn, product_number)  VALUES ('" . $product['goods_id'] . "', '{$goods_attr}', '{$value}', '" . $product['product_number'][$key] . "')";
     if (!$GLOBALS['db']->query($sql)) {
         continue;
         //sys_msg($_LANG['sys']['wrong'] . $_LANG['cannot_add_products'], 1, array(), false);
     }
     //貨品號為空 自動補貨品號
     if (empty($value)) {
         $sql = "UPDATE " . $GLOBALS['ecs']->table('products') . "\r\n                    SET product_sn = '" . $goods['goods_sn'] . "g_p" . $GLOBALS['db']->insert_id() . "'\r\n                    WHERE product_id = '" . $GLOBALS['db']->insert_id() . "'";
         $GLOBALS['db']->query($sql);
     }
     /* 修改商品表庫存 */
     $product_count = product_number_count($product['goods_id']);
     if (update_goods($product['goods_id'], 'goods_number', $product_count)) {
         //記錄日誌
         admin_log($product['goods_id'], 'update', 'goods');
     }
 }
 clear_cache_files();
 /* 返回 */
 if ($insert) {
     $link[] = array('href' => 'goods.php?act=add', 'text' => $_LANG['02_goods_add']);
     $link[] = array('href' => 'goods.php?act=list', 'text' => $_LANG['01_goods_list']);
     $link[] = array('href' => 'goods.php?act=product_list&goods_id=' . $product['goods_id'], 'text' => $_LANG['18_product_list']);
 } else {
     $link[] = array('href' => 'goods.php?act=list&uselastfilter=1', 'text' => $_LANG['01_goods_list']);
     $link[] = array('href' => 'goods.php?act=edit&goods_id=' . $product['goods_id'], 'text' => $_LANG['edit_goods']);
     $link[] = array('href' => 'goods.php?act=product_list&goods_id=' . $product['goods_id'], 'text' => $_LANG['18_product_list']);
 }
開發者ID:dlpc,項目名稱:ecshop,代碼行數:31,代碼來源:goods.php

示例3: VALUES

    if ($return_id == "") {
        $sql = "INSERT INTO " . $GLOBALS['ecs']->table('stock_control') . " (goods_id, goods_name, log_time, goods_number, costing_price )  VALUES ('" . $goods_id . "', '" . $goods_name . "', '" . gmtime() . "', '" . $goods_number . "' , '" . $costing_price . "')";
        $GLOBALS['db']->query($sql);
        $stock_control_id = $GLOBALS['db']->insert_id();
        //返回stock_stock_control 所產生的最新的id
    } else {
        $goods_number_new = $return_goods_number + $goods_number;
        $GLOBALS['db']->query("UPDATE " . $ecs->table('stock_control') . " SET log_time = '" . gmtime() . "', goods_number = '" . $goods_number_new . "' WHERE id='{$return_id}'");
        $stock_control_id = $return_id;
    }
    $stock_type = 1;
    //商品入庫處理, 默認為 1(增加)  -1(減少)
    $stock_status = 1;
    //1:添加入庫產品,2:發貨時候庫存減少狀態,3:庫存不夠的時候,4 退貨的時候庫存會增加狀態)
    //寫入相關的入庫數據記錄
    $sql_log = "INSERT INTO " . $GLOBALS['ecs']->table('stock_control_log') . " (stock_id, goods_name, log_time, goods_number, stock_type, costing_price, stock_number, stock_status, stock_note, ip_address )  VALUES ('" . $stock_control_id . "', '" . $goods_name . "', '" . gmtime() . "', '" . $goods_number . "', '" . $stock_type . "', '" . $costing_price . "' , '" . $stock_number . "' , '" . $stock_status . "', '" . real_ip() . "','" . real_ip() . "')";
    $GLOBALS['db']->query($sql_log);
    //入庫成功之後, 商品的總的庫存數量也要相應的增加
    $goods_number_old = $GLOBALS['db']->getOne("SELECT goods_number FROM " . $GLOBALS['ecs']->table('goods') . " WHERE goods_id = {$goods_id} ");
    $goods_num = $goods_number_old + $goods_number;
    if (update_goods($goods_id, 'goods_number', $goods_num)) {
        //記錄日誌
        //admin_log($goods_id, 'update', 'goods');
    }
    /* 顯示商品信息頁麵 */
    assign_query_info();
    $link[0]['text'] = $_LANG['add_success_message'];
    $link[0]['href'] = 'goods_stock_control.php?act=list';
    clear_cache_files();
    sys_msg($goods_name . $_LANG['succed_message'], 0, $link);
}
開發者ID:dlpc,項目名稱:ecshop,代碼行數:31,代碼來源:goods_stock_control.php


注:本文中的update_goods函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。