arr icon indicating copy to clipboard operation
arr copied to clipboard

tree有问题

Open boume opened this issue 8 years ago • 2 comments

改为

public function tree($data, $title, $fieldPri = 'cid', $fieldPid = 'pid')
    {
        if ( ! is_array($data) || empty($data)) {
            return [];
        }
        $arr = $this->channelList($data, 0, '', $fieldPri, $fieldPid);
        $tmpArr = $arr;
        foreach ($arr as $k => $v) {
            $nexValue = next($tmpArr);
            $str = "";
            if ($v['_level'] > 2) {
                for ($i = 1; $i < $v['_level'] - 1; $i++) {
                    $str .= "│&nbsp;&nbsp;&nbsp;&nbsp;";
                }
            }
            if ($v['_level'] != 1) {
                $t = $title ? $v[$title] : '';
                /*if (isset($arr[$k + 1])
                    && $arr[$k + 1]['_level'] >= $arr[$k]['_level']
                ) {
                    $arr[$k]['_'.$title] = $str."├─ ".$v['_html'].$t;
                } else {
                    $arr[$k]['_'.$title] = $str."└─ ".$v['_html'].$t;
                }*/
                if ($nexValue && $nexValue['_level'] >= $v['_level']) {
                    $arr[$k]['_'.$title] = $str."├─ ".$v['_html'].$t;
                }else{
                    $arr[$k]['_'.$title] = $str."└─ ".$v['_html'].$t;
                }
            } else {
                $arr[$k]['_'.$title] = $v[$title];
            }
        }
        //设置主键为$fieldPri
        $data = [];
        foreach ($arr as $d) {
            //            $data[$d[$fieldPri]] = $d;
            $data[] = $d;
        }

        return $data;
    }

boume avatar May 11 '17 02:05 boume

Default value for parameters with a class type hint can only be NULL image

liuhaiqiang999 avatar Mar 26 '19 08:03 liuhaiqiang999

font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}



这个库有段时间没有维护了,新版本是静态调用的

    
        
    


  

    
                
        
            
                
                        
                            
                        
                        
                            向军大叔
                        
                
                    
                        
                                ***@***.***
                        
                    
            
        
    
    


    签名由
    网易邮箱大师
    定制




在2021年12月1日 ***@***.***> 写道: 

Default value for parameters with a class type hint can only be NULL

确实有问题。我也想提来着,老版本没问题,但composer里找不到老版本了。

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.

houdunwang avatar Dec 02 '21 16:12 houdunwang