$type])->field('id,content')->findOrEmpty()->toArray(); return $decorate['content'] ?? []; } /** * @notes 设置主题配置内容 * @return mixed * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author cjhao * @date 2021/8/4 20:36 */ public function setContent(array $params):bool { $decorate = DecorateThemeConfig::where(['type' => $params['type']])->findOrEmpty(); $decorate->type = $params['type']; $decorate->content = $params['content']; $decorate->save(); return true; } }