1, 'deleted' => 0, 'type' => $type]; $bases = $this->where($map)->order('sort desc,id desc')->column('code,name,content', 'code'); if (count($data) > 0) foreach ($data as &$vo) $vo[$bind] = $bases[$vo[$field]] ?? []; return $bases; } /** * 获取所有数据类型 * @param boolean $simple * @return array */ public function types(bool $simple = false): array { $types = $this->where(['deleted' => 0])->distinct(true)->column('type'); if (empty($types) && empty($simple)) $types = ['身份权限']; return $types; } /** * 格式化创建时间 * @param string $value * @return string */ public function getCreateAtAttr(string $value): string { return format_datetime($value); } }