ecshop二次开发 后台的收货地址有问题

2014-09-28 22:34 来源:www.chinab4c.com 作者:ecshop专家

   ecshop二次开发 后台的收货地址有问题,我们发现ecshop在后台的地址中,调用了三级区域,但是在ecshop地址接口前台却没有显示三级区域

   其实解决也很简单,重要通过order_info中的province,citydistrict三个字段和ecshop数据库中的region表联合查询。就能查询出具体的三级区域,

    $sql = "SELECT concat(IFNULL(c.region_name, ''), '  ', IFNULL(p.region_name, ''), " .

                "'  ', IFNULL(t.region_name, ''), '  ', IFNULL(d.region_name, '')) AS region " .

            "FROM " . $ecs->table('order_info') . " AS o " .

                "LEFT JOIN " . $ecs->table('region') . " AS c ON o.country = c.region_id " .

                "LEFT JOIN " . $ecs->table('region') . " AS p ON o.province = p.region_id " .

                "LEFT JOIN " . $ecs->table('region') . " AS t ON o.city = t.region_id " .

                "LEFT JOIN " . $ecs->table('region') . " AS d ON o.district = d.region_id " .

            "WHERE o.order_id = '$order[order_id]'";

     以上就能解决ecshop二次开发 后台的收货地址有问题。

    来源:http://www.chinab4c.com