当前位置: 首页>>代码示例>>PHP>>正文


PHP handle_member_price函数代码示例

本文整理汇总了PHP中handle_member_price函数的典型用法代码示例。如果您正苦于以下问题:PHP handle_member_price函数的具体用法?PHP handle_member_price怎么用?PHP handle_member_price使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了handle_member_price函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

     foreach ($goods_attr_list as $attr_id => $attr_value_list) {
         foreach ($attr_value_list as $attr_value => $info) {
             if ($info['sign'] == 'insert') {
                 $sql = 'INSERT INTO ' . $ecs->table('goods_attr') . ' (attr_id, goods_id, attr_value, attr_price)' . "VALUES ('{$attr_id}', '{$goods_id}', '{$attr_value}', '{$info['attr_price']}')";
             } elseif ($info['sign'] == 'update') {
                 $sql = 'UPDATE ' . $ecs->table('goods_attr') . " SET attr_price = '{$info['attr_price']}' WHERE goods_attr_id = '{$info['goods_attr_id']}' LIMIT 1";
             } else {
                 $sql = 'DELETE FROM ' . $ecs->table('goods_attr') . " WHERE goods_attr_id = '{$info['goods_attr_id']}' LIMIT 1";
             }
             $db->query($sql);
         }
     }
 }
 /* 处理会员价格 */
 if (isset($_POST['user_rank']) && isset($_POST['user_price'])) {
     handle_member_price($goods_id, $_POST['user_rank'], $_POST['user_price']);
 }
 /* 处理优惠价格 */
 if (isset($_POST['volume_number']) && isset($_POST['volume_price'])) {
     $temp_num = array_count_values($_POST['volume_number']);
     foreach ($temp_num as $v) {
         if ($v > 1) {
             sys_msg($_LANG['volume_number_continuous'], 1, array(), false);
             break;
         }
     }
     handle_volume_price($goods_id, $_POST['volume_number'], $_POST['volume_price']);
 }
 /* 处理扩展分类 */
 if (isset($_POST['other_cat'])) {
     handle_other_cat($goods_id, array_unique($_POST['other_cat']));
开发者ID:netroby,项目名称:ecshop,代码行数:31,代码来源:suppliers_goods.php

示例2: foreach

     foreach ($goods_attr_list as $attr_id => $attr_value_list) {
         foreach ($attr_value_list as $attr_value => $info) {
             if ($info['sign'] == 'insert') {
                 $sql = "INSERT INTO " . $ecs->table('goods_attr') . " (attr_id, goods_id, attr_value, attr_price)" . "VALUES ('{$attr_id}', '{$goods_id}', '{$attr_value}', '{$info['attr_price']}')";
             } elseif ($info['sign'] == 'update') {
                 $sql = "UPDATE " . $ecs->table('goods_attr') . " SET attr_price = '{$info['attr_price']}' WHERE goods_attr_id = '{$info['goods_attr_id']}' LIMIT 1";
             } else {
                 $sql = "DELETE FROM " . $ecs->table('goods_attr') . " WHERE goods_attr_id = '{$info['goods_attr_id']}' LIMIT 1";
             }
             $db->query($sql);
         }
     }
 }
 /* 处理会员价格和起购数量 add by zenghd for date 2014-08-19 */
 if (isset($_POST['user_rank']) && isset($_POST['user_price']) && isset($_POST['rank_start_num'])) {
     handle_member_price($goods_id, $_POST['user_rank'], $_POST['user_price'], $_POST['rank_start_num']);
 }
 /* 处理优惠价格 */
 if (isset($_POST['volume_number']) && isset($_POST['volume_price'])) {
     $temp_num = array_count_values($_POST['volume_number']);
     foreach ($temp_num as $v) {
         if ($v > 1) {
             sys_msg($_LANG['volume_number_continuous'], 1, array(), false);
             break;
         }
     }
     handle_volume_price($goods_id, $_POST['volume_number'], $_POST['volume_price']);
 }
 /* 处理扩展分类 */
 if (isset($_POST['other_cat'])) {
     handle_other_cat($goods_id, array_unique($_POST['other_cat']));
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:goods.php

示例3: API_AddGoods


//.........这里部分代码省略.........
                    $goods_attr_list[$attr_id][$attr_value]['attr_price'] = $attr_price;
                } else {
                    // 如果原来没有,标记为新增
                    $goods_attr_list[$attr_id][$attr_value]['sign'] = 'insert';
                    $goods_attr_list[$attr_id][$attr_value]['attr_price'] = $attr_price;
                }
                $val_arr = explode(' ', $attr_value);
                foreach ($val_arr as $k => $v) {
                    if (!isset($keywords_arr[$v]) && $attr_list[$attr_id] == "1") {
                        $keywords_arr[$v] = $v;
                    }
                }
            }
        }
        $keywords = join(' ', array_flip($keywords_arr));
        $sql = "UPDATE " . $GLOBALS['ecs']->table('goods') . " SET keywords = '{$keywords}' WHERE goods_id = '{$goods_id}' LIMIT 1";
        $GLOBALS['db']->query($sql);
        /* 插入、更新、删除数据 */
        foreach ($goods_attr_list as $attr_id => $attr_value_list) {
            foreach ($attr_value_list as $attr_value => $info) {
                if ($info['sign'] == 'insert') {
                    $sql = "INSERT INTO " . $GLOBALS['ecs']->table('goods_attr') . " (attr_id, goods_id, attr_value, attr_price)" . "VALUES ('{$attr_id}', '{$goods_id}', '{$attr_value}', '{$info['attr_price']}')";
                } elseif ($info['sign'] == 'update') {
                    $sql = "UPDATE " . $GLOBALS['ecs']->table('goods_attr') . " SET attr_price = '{$info['attr_price']}' WHERE goods_attr_id = '{$info['goods_attr_id']}' LIMIT 1";
                } else {
                    $sql = "DELETE FROM " . $GLOBALS['ecs']->table('goods_attr') . " WHERE goods_attr_id = '{$info['goods_attr_id']}' LIMIT 1";
                }
                $GLOBALS['db']->query($sql);
            }
        }
    }
    /* 处理会员价格 */
    if (isset($_POST['user_rank']) && isset($_POST['user_price'])) {
        handle_member_price($goods_id, $_POST['user_rank'], $_POST['user_price']);
    }
    /* 处理扩展分类 */
    if (isset($_POST['other_cat'])) {
        handle_other_cat($goods_id, array_unique($_POST['other_cat']));
    }
    if ($is_insert) {
        /* 处理关联商品 */
        handle_link_goods($goods_id);
        /* 处理组合商品 */
        handle_group_goods($goods_id);
        /* 处理关联文章 */
        handle_goods_article($goods_id);
    }
    /* 如果有图片,把商品图片加入图片相册 */
    if (isset($img)) {
        $sql = "INSERT INTO " . $GLOBALS['ecs']->table('goods_gallery') . " (goods_id, img_url, img_desc, thumb_url, img_original) " . "VALUES ('{$goods_id}', '{$gallery_img}', '', '{$gallery_thumb}', '{$img}')";
        $GLOBALS['db']->query($sql);
    }
    /* 处理相册图片
       handle_gallery_image($goods_id, $_FILES['img_url'], $_POST['img_desc']);
       */
    if (!empty($_POST['img_url'])) {
        foreach ($_POST['img_url'] as $key => $img_url) {
            if (!in_array($img_url['Type'], $allow_file_type)) {
                client_show_message(205);
            }
            if (client_check_image_size($img_url['Data']) === false) {
                client_show_message(206);
            }
            $img_original = upload_image($img_url);
            if ($img_original === false) {
                continue;
开发者ID:Ryan007,项目名称:mybb,代码行数:67,代码来源:lib_api.php


注:本文中的handle_member_price函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。