$type, 'status' => 1, 'deleted' => 0]; $bases = static::mk()->where($map)->order('sort desc,id asc')->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 static function types(bool $simple = false): array { $types = static::mk()->where(['deleted' => 0])->distinct()->column('type'); if (empty($types) && empty($simple)) $types = ['系统通用参数']; return $types; } /** * 格式化创建时间 * @param mixed $value * @return string */ public function getCreateAtAttr($value): string { return format_datetime($value); } }