fix:更新已知bug,优化代码

This commit is contained in:
Ying
2022-11-28 19:11:12 +08:00
parent f6aee95cfc
commit 9445b206a2
1378 changed files with 53759 additions and 20789 deletions

View File

@@ -3,8 +3,11 @@ declare (strict_types = 1);
namespace app\common\model\system;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\db\Query;
use think\Model;
use think\facade\Db;
use think\model\concern\SoftDelete;
/**
@@ -21,21 +24,23 @@ class Department extends Model
/**
* 树形分类
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public static function getListTree(): array
{
$array = self::select()->toArray();
if (is_array($array) && !empty($array)) {
if (!empty($array)) {
return list_to_tree($array);
}
return [];
}
// 字段修改器
/**
* 字段修改器
*/
public function setSortAttr($value)
{
if (is_empty($value)) {