Ecshop配送区域批量添加其它区
日期:2018-07-19
ECShop的收货地址有很多地区是没有的,给客户选择带来不便,经常会发现选择区域的时候出现缺少现象。ECSHOP插件网写了几句批量添加其它区的SQL命令php代码,大家运行一下即可批量添加"其它区",供给没有区选择的客户选择。
<?php /** * ECSHOP 地区批量添加其它区 * ---------------------------------------------------------------------------- * ECSHOP插件网 * https://www.ecshopok.com * ---------------------------------------------------------------------------- * @author: ECSHOP插件网 * @qq: 87820657 * @date: 2018-05-08 */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); $region_sql = mysql_query("SELECT * FROM " . $GLOBALS['ecs']->table('region') . " WHERE region_type = 2"); while ($region= mysql_fetch_array($region_sql)) { $r[] = array("parent_id"=>$region['region_id']); } for ($i = 0; $i < sizeof($r); $i++) { $parent_sql = mysql_query("SELECT * FROM " . $GLOBALS['ecs']->table('region') . " WHERE region_type = 3 AND region_name LIKE '其它区' AND parent_id = ".$r[$i][parent_id]); $parent = mysql_fetch_array($parent_sql); if (is_array($parent)) { echo $i."已有<br />"; } else { mysql_query("INSERT INTO " . $GLOBALS['ecs']->table('region') . " (`region_id`, `parent_id`, `region_name`, `region_type`, `agency_id`) VALUENULL".$r[$i][parent_id].", '其它区', '3', '0')"); echo $i."添加成功<br />"; } } ?>
本文原创地址:https://ecshopok.com/article-394.html
版权所有 © 转载时必须以链接形式注明出处!
觉得本文对您有用,想收藏下来!方法很简单:请点击-〉
我们一直坚持白天工作、晚上熬夜更新资源,付出了巨大的精力和时间,其中的辛酸难以言述。





暂无评论,来发表一个吧