$params['label_name'] ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); self::setError($e->getMessage()); return false; } } /** * @notes 编辑用户标签 * @param array $params * @return bool * @author admin * @date 2024/06/17 17:02 */ public static function edit(array $params): bool { Db::startTrans(); try { UserLabel::where('label_id', $params['label_id'])->update([ 'label_name' => $params['label_name'] ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); self::setError($e->getMessage()); return false; } } /** * @notes 删除用户标签 * @param array $params * @return bool * @author admin * @date 2024/06/17 17:02 */ public static function delete(array $params): bool { return UserLabel::destroy($params['label_id']); } /** * @notes 获取用户标签详情 * @param $params * @return array * @author admin * @date 2024/06/17 17:02 */ public static function detail($params): array { return UserLabel::findOrEmpty($params['label_id'])->toArray(); } }