// +---------------------------------------------------------------------- namespace app\common\dao\store\parameter; use app\common\dao\BaseDao; use app\common\model\store\parameter\Parameter; class ParameterDao extends BaseDao { protected function getModel(): string { return Parameter::class; } /** * 清除特定字段中具有指定ID的记录。 * * 此方法通过提供的ID和字段名称,从数据库中删除符合条件的记录。 * 它首先获取模型对应的数据库实例,然后使用提供的字段和ID构建删除条件, * 最后执行删除操作。 * * @param int $id 主键ID,用于指定要删除的记录。 * @param string $field 要用于删除条件的字段名称。 */ public function clear(int $id, string $field) { $this->getModel()::getDB()->where($field, $id)->delete(); } }