定制 azhida/laravel-tools 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

azhida/laravel-tools

Composer 安装命令:

composer require azhida/laravel-tools

包简介

收集整理常用方法

README 文档

README

收集整理常用方法.

Installing

$ composer require azhida/laravel-tools -vvv
发布迁移文件
$ php artisan vendor:publish
# 选择 Azhida\LaravelTools\ServiceProvider
执行迁移文件
$ php artisan migrate --path=database/migrations/2021_08_31_091229_create_test_binary_trees_table.php
$ php artisan migrate --path=database/migrations/2021_08_31_092504_create_test_binary_tree_max_depths_table.php

Usage

常用方法:

  • Tool::arrayToTree() 一维数组转树形结构

封装几个标准二叉树的操作方法:

添加节点
// 添加一个节点
TestBinaryTree::addNode_first()

// 添加单个子节点
TestBinaryTree::addNode(TestBinaryTree $parent, $leg_of_parent, $show_info = []);

// 批量添加子节点 -- 指定节点指定边
TestBinaryTree::addNodes_y($id, $leg, $depth = 1, $start_time = '');

// 批量添加子节点 -- 从指定节点下一层开始添加,添加顺序为 depth asc ,id asc
TestBinaryTree::addNodes_x($id, $depth = 10);
获取节点
// 获取ID节点下可添加的点位 -- 自上而下,从左到右
TestBinaryTree::searchAddEnableNodeById_DepthAsc_LToR($id);

// 获取ID节点下可添加的点位 -- 左腿【右腿】最底部
TestBinaryTree::searchAddEnableNodeById_Leg_MaxDepth($id, $leg = 'L');

// 获取ID的所有上级
TestBinaryTree::getParentsById($id);

// 获取ID所有子节点
TestBinaryTree::getSonsById($id, $depth = 10);

// 判断 A、D 两个节点是否存在祖孙关系
TestBinaryTree::isAncestor_AD($ancestor_id, $descendant_id);

Contributing

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. Contribute new features or update the wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

License

MIT

统计信息

  • 总下载量: 34
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固