'integer', 'pid' => 'integer', 'status' => 'integer', 'input_type' => 'integer', 'sort' => 'integer']; const CREATED_AT = 'create_time'; const UPDATED_AT = 'update_time'; /** * 获取 * @return array */ public function getTopConfigModule(): array { $res = $this->where('pid', 0)->get(['id', 'name']); if (empty($res)) return []; return $res->toArray(); } /** * @param int $pid * @return array */ public function getConfigByPid(int $pid): array { $res = $this ->where('pid', $pid) ->orderBy('sort','desc') ->get(['id', 'pid', 'name', 'value','param','desc','input_type','sort','key']); if (empty($res)) return []; return $res->toArray(); } }