• 批量修改zencart型号:品牌名称+型号格式


    批量修改zencart型号:品牌名称+型号格式

    将下面代码保存为zc_change_model.php,上传到网站根目录运行即可,操作前先备份数据库

    <?php
    /***
    批量修改zencart型号:品牌名称+型号格式
    ***/
    require('includes/application_top.php');
    echo '正在处理...';
    $products_query = "select products_id from " . TABLE_PRODUCTS . " order by products_id";
    $products = $db->Execute($products_query);
    $id_array = array();
    while(!$products->EOF){
        $id_array[] = $products->fields['products_id'];
        $products->MoveNext();     
    }
    
    foreach($id_array as $val){
        $manufacturer = $db->Execute("select p.products_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p where m.manufacturers_id = p.manufacturers_id and p.products_id = '".(int)$val."' limit 0,1");
        if($manufacturer->fields['manufacturers_name']){
            $manufacturer_name = $manufacturer->fields['manufacturers_name'];
            $products=$db->Execute("update " . TABLE_PRODUCTS . " set products_model = CONCAT('{$manufacturer_name}-', products_model) where products_id = " . (int)$val);
        }
    }
    echo 'OK!处理完毕';
    require(DIR_WS_INCLUDES . 'application_bottom.php');
    ?>
    转载请注明出处!小鱼阁工作室 -专注zencart建站,织梦企业建站,ecshop商城,二次开发,产品采集,模板修改!技术QQ 631992791
  • 相关阅读:
    Mybatis查询select操作
    插入排序和它的进化希尔排序
    关于c头文件的使用的小记录
    Mybatis介绍
    spring tool suite开发环境搭建
    一个简单的jsp+servlet登录界面的总结
    纠正关于线程的错误理解
    表达式语言EL简单学习
    [BZOJ 1804] Flood
    [POJ 1739] Tony's Tour
  • 原文地址:https://www.cnblogs.com/afish/p/3938818.html
Copyright © 2020-2023  润新知