14 Commits

Author SHA1 Message Date
daodao97
cb2b2b5428 Merge branch 'master' of github.com:hyperf-admin/hyperf-admin 2021-06-26 11:28:27 +08:00
daodao97
8b44c279c1 docs: website 2021-06-26 11:28:11 +08:00
刀刀
8f1df241a4 Merge pull request #53 from AKMCC-hub/master
feat: 脚手架增加group_by语法支持
2021-06-16 09:57:28 +08:00
刀刀
9abd51cc6b Update AbstractController.php 2021-06-16 09:56:41 +08:00
七戒
f4c429ea28 feat: 脚手架增加group_by语法支持 2021-06-15 15:52:14 +08:00
daodao97
839bd1e0b9 fix: tree child api 2021-05-18 17:49:55 +08:00
daodao97
4ccb7200eb Merge branch 'master' of github.com:hyperf-admin/hyperf-admin 2021-05-18 11:47:14 +08:00
daodao97
d79fdca30b fix: move_local_file_to_filesystem chmod 2021-05-18 11:46:30 +08:00
刀刀
11f249669e Update form.md 2021-04-26 09:46:10 +08:00
刀刀
a707dae623 Update README.md 2021-04-22 19:56:56 +08:00
刀刀
d5a7a584df Update install.md 2021-04-22 19:54:31 +08:00
刀刀
c0379e5137 Update README.md 2021-04-22 10:51:12 +08:00
刀刀
bde50ad7e2 Update README.md 2021-04-22 10:31:40 +08:00
daodao97
e4dd791a66 perf: tools 2021-04-21 16:54:21 +08:00
8 changed files with 81 additions and 9 deletions

View File

@@ -6,7 +6,7 @@
> 演示站点部署在`亚马逊免费主机`, 国内访问可能会慢
![HyperfAdmin架构](https://cdn.jsdelivr.net/gh/daodao97/FigureBed@master/uPic/sJaJti.png)
![HyperfAdmin架构](https://gitee.com/daodao97/asset/raw/master/uPic/sJaJti.png)
前端为`vue multiple page`多页模式, 可以按模块打包, 默认包含两个模块`default` 默认模块, `system`系统管理模块, 绝大部分业务组件在`src/components`目录

54
bin/release.sh Executable file
View File

@@ -0,0 +1,54 @@
#!/usr/bin/env bash
set -e
if (( "$#" != 1 ))
then
echo "Tag has to be provided"
exit 1
fi
NOW=$(date +%s)
CURRENT_BRANCH="master"
VERSION=$1
BASEPATH=$(cd `dirname $0`; cd ../src/; pwd)
# Always prepend with "v"
if [[ $VERSION != v* ]]
then
VERSION="v$VERSION"
fi
git tag $VERSION
git push origin --tags
repos=$(ls $BASEPATH)
for REMOTE in $repos
do
echo ""
echo ""
echo "Cloning $REMOTE";
TMP_DIR="/tmp/hyperf-split"
REMOTE_URL="git@github.com:hyperf-admin/$REMOTE.git"
rm -rf $TMP_DIR;
mkdir $TMP_DIR;
(
cd $TMP_DIR;
git clone $REMOTE_URL .
git checkout "$CURRENT_BRANCH";
if [[ $(git log --pretty="%d" -n 1 | grep tag --count) -eq 0 ]]; then
echo "Releasing $REMOTE"
git tag $VERSION
git push origin --tags
fi
)
done
TIME=$(echo "$(date +%s) - $NOW" | bc)
printf "Execution time: %f seconds" $TIME

View File

@@ -9,7 +9,7 @@ REPOS=$@
function split()
{
SHA1=`splitsh-lite --prefix=$1`
SHA1=`./bin/splitsh-lite --prefix=$1`
git push $2 "$SHA1:refs/heads/$CURRENT_BRANCH" -f
}

BIN
bin/splitsh-lite Executable file

Binary file not shown.

View File

@@ -112,7 +112,7 @@ type表单项类型以下是支持的组件列表以下所有组件 pro
"field_name|字段名" => [
"type" => "textarea",
"props" => [
"row" => 6, // 行数, 默认6
"rows" => 6, // 行数, 默认6
]
]
]

View File

@@ -70,7 +70,7 @@ composer require hyperf-admin/hyperf-admin
如果存在依赖包的版本号问题, 注意, 请使用 composer2
```shell
composer require hyperf-admin/hyperf-admin:0.2.0 --with-all-dependencies
composer require hyperf-admin/hyperf-admin -W
```
!> hyperf-admin 为分包模式, 实际应用中请根据情况安装

View File

@@ -85,7 +85,9 @@ if (!function_exists('move_local_file_to_filesystem')) {
if ($private) {
$filesystem->setVisibility($save_file_path, AdapterInterface::VISIBILITY_PRIVATE);
}
$filesystem->chmod($save_file_path, 0644);
if (method_exists($filesystem, 'chmod')) {
$filesystem->chmod($save_file_path, 0644);
}
$meta = $filesystem->getMetadata($save_file_path);
switch (config("file.storage.{$bucket}.driver")) {
case \Hyperf\Filesystem\Adapter\LocalAdapterFactory::class:

View File

@@ -203,11 +203,12 @@ abstract class AbstractController extends Controller
}
}
$order_by = $this->options['order_by'] ?? '';
$group_by = $this->options['group_by'] ?? '';
if ($sortColumn = $this->request->input('_sort_column') && $sortType = $this->request->input('_sort_type')) {
$order_by = $sortColumn . ' ' . $sortType;
}
if (empty($conditions) && !($this->options['defaultList'] ?? true)) {
return compact('page', 'size', 'conditions', 'order_by', 'columns', 'table_options');
return compact('page', 'size', 'conditions', 'order_by', 'columns', 'table_options', 'group_by');
}
if (method_exists($this, 'beforeListQuery')) {
$hook_params = get_class_method_params_name($this, 'beforeListQuery');
@@ -215,9 +216,11 @@ abstract class AbstractController extends Controller
$this->beforeListQuery($conditions, $order_by);
} elseif (count($hook_params) === 1) {
$this->beforeListQuery($conditions);
} elseif (count($hook_params) === 4) {
$this->beforeListQuery($conditions, $order_by, $group_by, $columns);
}
}
return compact('page', 'size', 'conditions', 'order_by', 'columns', 'table_options');
return compact('page', 'size', 'conditions', 'order_by', 'columns', 'table_options', 'group_by');
}
/**
@@ -232,13 +235,25 @@ abstract class AbstractController extends Controller
$order_by,
$columns,
$tableOptions,
$group_by
] = array_values($this->makeWhere());
$entity = $this->getEntity();
$count = $entity->count($conditions);
if ($group_by) {
$entity->getModel()->groupBy($group_by);
$count_query = clone $entity;
$count = $count_query->getModel()->select(
gettype($group_by) == 'array' ? $group_by[0] : $group_by,
DB::raw('count(*) as total')
)->get()->count();
} else {
$count = $entity->count($conditions);
}
$list = [];
if ($count) {
$attr['select'] = $columns;
$order_by && $attr['order_by'] = $order_by;
$group_by && $attr['group_by'] = $group_by;
$list = $entity->list($conditions, $attr, $page, $size);
}
$list = $this->listFilter($list, $tableOptions);
@@ -390,7 +405,8 @@ abstract class AbstractController extends Controller
$order_by = $this->options['order_by'] ?? '';
$attr['select'] = $columns;
$order_by && $attr['order_by'] = $order_by;
$childs = $this->getEntity()->list(['pid' => $id], $attr);
$parent_key = $this->options['table']['tree']['pid'] ?? 'pid';
$childs = $this->getEntity()->list([$parent_key => $id], $attr);
foreach ($tableOptions as $item) {
if (!isset($item['render'])) {
continue;