find($params['id'])->toArray(); } /** * @notes 编辑文章分类 * @param $params * @author Tab * @date 2021/7/13 14:25 */ public static function edit($params) { ArticleCategory::update($params); } /** * @notes 删除文章分类 * @param $params * @author Tab * @date 2021/7/13 14:25 */ public static function delete($params) { ArticleCategory::destroy($params['id']); } /** * @notes 修改是否显示状态 * @param $params * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author Tab * @date 2021/7/14 11:36 */ public static function isShow($params) { $articleCategory = ArticleCategory::find($params['id']); $articleCategory->is_show = $articleCategory->getData('is_show') ? 0: 1; $articleCategory->save(); } }