yf_shop__get_children_cat user module

Fileplugins/shop/modules/shop/yf_shop__get_children_cat.class.php
Usemodule('shop__get_children_cat'), URL ?object=shop__get_children_cat

Public properties

PropertyDefaultDescription
None declared in this class.

Public methods 1

None without a leading underscore.

Methods starting with _ hooks and helpers; not routable as page actions

public function _get_children_cat($id)
    public function _get_children_cat($id)
    {
        $cat_id = null;
        $sql1 = 'SELECT id FROM shop_sys_category_items WHERE parent_id = ' . $id;
        $cat = db()->query($sql1);
        $cat_id = '';
        while ($A = db()->fetch_assoc($cat)) {
            $cat_id .= $A['id'] . ',';
            $sql2 = 'SELECT id FROM shop_sys_category_items WHERE parent_id = ' . $A['id'];
            $res_q = db()->query($sql2);
            if (db()->num_rows($res_q)) {
                module('shop')->_get_children_cat($A['id']);
            }
        }
        $cat_id = rtrim($cat_id, ',');
        return $cat_id;
    }